Commit ad81e620 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[NativeFS] Add origin trial integration for second OT.

Renames the existing trial to NativeFileSystem2, and make the same trial
name also trigger writable streams and cloneble handles.

Finally this also removes (the bindings for) the old write API, as this
API is not supposed to be part of the new origin trial. The implementation
of that method will be removed in future CLs.

Bug: 853326
Change-Id: I01bc2e091fed1c7036086783ad9ac713f0656be1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095437Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749464}
parent 92efee08
......@@ -10,7 +10,6 @@
RuntimeEnabled=NativeFileSystem,
ImplementedAs=NativeFileSystemFileHandle
] interface FileSystemFileHandle : FileSystemHandle {
[CallWith=ScriptState] Promise<FileSystemWriter> createWriter(optional FileSystemCreateWriterOptions options = {});
[CallWith=ScriptState, RuntimeEnabled=WritableFileStream, RaisesException] Promise<FileSystemWritableFileStream> createWritable(optional FileSystemCreateWriterOptions options = {});
[CallWith=ScriptState, RaisesException] Promise<File> getFile();
};
......@@ -71,8 +71,6 @@ ScriptPromise NativeFileSystemFileHandle::createWritable(
ScriptState* script_state,
const FileSystemCreateWriterOptions* options,
ExceptionState& exception_state) {
DCHECK(RuntimeEnabledFeatures::WritableFileStreamEnabled());
if (!mojo_ptr_) {
exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, "");
return ScriptPromise();
......
......@@ -318,6 +318,8 @@
// NativeFileSystem is in Origin Trial, which doesn't support having
// non-origin-trial-enabled features depend on it. https://crbug.com/1000486
// depends_on: ["NativeFileSystem"]
origin_trial_feature_name: "NativeFileSystem2",
origin_trial_os: ["win", "macosx", "linux", "chromeos"],
},
{
name: "CompositeAfterPaint",
......@@ -1109,7 +1111,7 @@
// on the command line (or via chrome://flags).
name: "NativeFileSystem",
status: {"Android": "test", "default": "experimental"},
origin_trial_feature_name: "NativeFileSystem",
origin_trial_feature_name: "NativeFileSystem2",
origin_trial_os: ["win", "macosx", "linux", "chromeos"],
},
{
......@@ -1928,6 +1930,8 @@
// NativeFileSystem is in Origin Trial, which doesn't support having
// non-origin-trial-enabled features depend on it. https://crbug.com/1000486
// depends_on: ["NativeFileSystem"]
origin_trial_feature_name: "NativeFileSystem2",
origin_trial_os: ["win", "macosx", "linux", "chromeos"],
},
{
name: "XSLT",
......
This is a testharness.js-based test.
Found 53 tests; 52 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS idl_test setup
PASS idl_test validation
PASS Partial interface Window: original interface defined
PASS Partial interface Window: member names are unique
PASS Partial interface FileSystemDirectoryHandle: original interface defined
PASS Partial interface FileSystemDirectoryHandle: member names are unique
PASS Partial interface Window[2]: member names are unique
PASS Window includes GlobalEventHandlers: member names are unique
PASS Window includes WindowEventHandlers: member names are unique
PASS Window includes WindowOrWorkerGlobalScope: member names are unique
PASS Window includes AnimationFrameProvider: member names are unique
PASS Window includes WindowSessionStorage: member names are unique
PASS Window includes WindowLocalStorage: member names are unique
PASS FileSystemHandle interface: existence and properties of interface object
PASS FileSystemHandle interface object length
PASS FileSystemHandle interface object name
PASS FileSystemHandle interface: existence and properties of interface prototype object
PASS FileSystemHandle interface: existence and properties of interface prototype object's "constructor" property
PASS FileSystemHandle interface: existence and properties of interface prototype object's @@unscopables property
PASS FileSystemHandle interface: attribute isFile
PASS FileSystemHandle interface: attribute isDirectory
PASS FileSystemHandle interface: attribute name
PASS FileSystemHandle interface: operation queryPermission(optional FileSystemHandlePermissionDescriptor)
PASS FileSystemHandle interface: operation requestPermission(optional FileSystemHandlePermissionDescriptor)
PASS FileSystemFileHandle interface: existence and properties of interface object
PASS FileSystemFileHandle interface object length
PASS FileSystemFileHandle interface object name
PASS FileSystemFileHandle interface: existence and properties of interface prototype object
PASS FileSystemFileHandle interface: existence and properties of interface prototype object's "constructor" property
PASS FileSystemFileHandle interface: existence and properties of interface prototype object's @@unscopables property
PASS FileSystemFileHandle interface: operation getFile()
FAIL FileSystemFileHandle interface: operation createWriter(optional FileSystemCreateWriterOptions) assert_own_property: interface prototype object missing non-static operation expected property "createWriter" missing
PASS FileSystemDirectoryHandle interface: existence and properties of interface object
PASS FileSystemDirectoryHandle interface object length
PASS FileSystemDirectoryHandle interface object name
PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object
PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object's "constructor" property
PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object's @@unscopables property
PASS FileSystemDirectoryHandle interface: operation getFile(USVString, optional FileSystemGetFileOptions)
PASS FileSystemDirectoryHandle interface: operation getDirectory(USVString, optional FileSystemGetDirectoryOptions)
PASS FileSystemDirectoryHandle interface: operation getEntries()
PASS FileSystemDirectoryHandle interface: operation removeEntry(USVString, optional FileSystemRemoveOptions)
PASS FileSystemDirectoryHandle interface: operation getSystemDirectory(GetSystemDirectoryOptions)
PASS FileSystemWriter interface: existence and properties of interface object
PASS FileSystemWriter interface object length
PASS FileSystemWriter interface object name
PASS FileSystemWriter interface: existence and properties of interface prototype object
PASS FileSystemWriter interface: existence and properties of interface prototype object's "constructor" property
PASS FileSystemWriter interface: existence and properties of interface prototype object's @@unscopables property
PASS FileSystemWriter interface: operation write(unsigned long long, (BufferSource or Blob or USVString))
PASS FileSystemWriter interface: operation truncate(unsigned long long)
PASS FileSystemWriter interface: operation close()
PASS Window interface: operation chooseFileSystemEntries(optional ChooseFileSystemEntriesOptions)
Harness: the test ran to completion.
This is a testharness.js-based test.
Found 53 tests; 52 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS idl_test setup
PASS idl_test validation
PASS Partial interface Window: original interface defined
PASS Partial interface Window: member names are unique
PASS Partial interface FileSystemDirectoryHandle: original interface defined
PASS Partial interface FileSystemDirectoryHandle: member names are unique
PASS Partial interface Window[2]: member names are unique
PASS Window includes GlobalEventHandlers: member names are unique
PASS Window includes WindowEventHandlers: member names are unique
PASS Window includes WindowOrWorkerGlobalScope: member names are unique
PASS Window includes AnimationFrameProvider: member names are unique
PASS Window includes WindowSessionStorage: member names are unique
PASS Window includes WindowLocalStorage: member names are unique
PASS FileSystemHandle interface: existence and properties of interface object
PASS FileSystemHandle interface object length
PASS FileSystemHandle interface object name
PASS FileSystemHandle interface: existence and properties of interface prototype object
PASS FileSystemHandle interface: existence and properties of interface prototype object's "constructor" property
PASS FileSystemHandle interface: existence and properties of interface prototype object's @@unscopables property
PASS FileSystemHandle interface: attribute isFile
PASS FileSystemHandle interface: attribute isDirectory
PASS FileSystemHandle interface: attribute name
PASS FileSystemHandle interface: operation queryPermission(optional FileSystemHandlePermissionDescriptor)
PASS FileSystemHandle interface: operation requestPermission(optional FileSystemHandlePermissionDescriptor)
PASS FileSystemFileHandle interface: existence and properties of interface object
PASS FileSystemFileHandle interface object length
PASS FileSystemFileHandle interface object name
PASS FileSystemFileHandle interface: existence and properties of interface prototype object
PASS FileSystemFileHandle interface: existence and properties of interface prototype object's "constructor" property
PASS FileSystemFileHandle interface: existence and properties of interface prototype object's @@unscopables property
PASS FileSystemFileHandle interface: operation getFile()
FAIL FileSystemFileHandle interface: operation createWriter(optional FileSystemCreateWriterOptions) assert_own_property: interface prototype object missing non-static operation expected property "createWriter" missing
PASS FileSystemDirectoryHandle interface: existence and properties of interface object
PASS FileSystemDirectoryHandle interface object length
PASS FileSystemDirectoryHandle interface object name
PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object
PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object's "constructor" property
PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object's @@unscopables property
PASS FileSystemDirectoryHandle interface: operation getFile(USVString, optional FileSystemGetFileOptions)
PASS FileSystemDirectoryHandle interface: operation getDirectory(USVString, optional FileSystemGetDirectoryOptions)
PASS FileSystemDirectoryHandle interface: operation getEntries()
PASS FileSystemDirectoryHandle interface: operation removeEntry(USVString, optional FileSystemRemoveOptions)
PASS FileSystemDirectoryHandle interface: operation getSystemDirectory(GetSystemDirectoryOptions)
PASS FileSystemWriter interface: existence and properties of interface object
PASS FileSystemWriter interface object length
PASS FileSystemWriter interface object name
PASS FileSystemWriter interface: existence and properties of interface prototype object
PASS FileSystemWriter interface: existence and properties of interface prototype object's "constructor" property
PASS FileSystemWriter interface: existence and properties of interface prototype object's @@unscopables property
PASS FileSystemWriter interface: operation write(unsigned long long, (BufferSource or Blob or USVString))
PASS FileSystemWriter interface: operation truncate(unsigned long long)
PASS FileSystemWriter interface: operation close()
PASS Window interface: existence and properties of interface object
Harness: the test ran to completion.
<!DOCTYPE html>
<!DOCTYPE html>
<meta charset="utf-8">
<!-- Generate token with the command:
generate_token.py http://127.0.0.1:8000 NativeFileSystem --expire-timestamp=2000000000
generate_token.py http://127.0.0.1:8000 NativeFileSystem2 --expire-timestamp=2000000000
-- -->
<meta http-equiv="origin-trial" content="AonTJaP9wZXkdR+DdBwuBMICov7GjWH/biHmn3yiSHBYZttDKA7ZMlB+rfnf7ImSFpYeePoQsT3Fg6i5yxNRNQoAAABYeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiTmF0aXZlRmlsZVN5c3RlbSIsICJleHBpcnkiOiAyMDAwMDAwMDAwfQ==">
<meta http-equiv="origin-trial" content="AmmBxJTKsdbb26LLpdAVmIKBvVxU6fKf6UZDoMXiD+b9bULkOHzUTtZ4dNwHMhI7tZzO+tNgmWCzNK2MLoZsvAEAAABZeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiTmF0aXZlRmlsZVN5c3RlbTIiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0=">
<title>Native File System API - interfaces exposed by origin trial</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
......@@ -12,7 +12,7 @@ generate_token.py http://127.0.0.1:8000 NativeFileSystem --expire-timestamp=2000
test(t => {
OriginTrialsHelper.check_properties_exist(this, {
'FileSystemHandle': ['isFile', 'isDirectory', 'name', 'queryPermission', 'requestPermission'],
'FileSystemFileHandle': ['getFile', 'createWriter'],
'FileSystemFileHandle': ['getFile', 'createWritable'],
'FileSystemDirectoryHandle': ['getFile', 'getDirectory', 'getEntries', 'removeEntry'],
'FileSystemWriter': ['write', 'truncate', 'close'],
'global': ['chooseFileSystemEntries'],
......
......@@ -540,7 +540,6 @@ interface FileSystemFileHandle : FileSystemHandle
attribute @@toStringTag
method constructor
method createWritable
method createWriter
method getFile
interface FileSystemHandle
attribute @@toStringTag
......
......@@ -475,7 +475,6 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] attribute @@toStringTag
[Worker] method constructor
[Worker] method createWritable
[Worker] method createWriter
[Worker] method getFile
[Worker] interface FileSystemHandle
[Worker] attribute @@toStringTag
......
......@@ -2440,7 +2440,6 @@ interface FileSystemFileHandle : FileSystemHandle
attribute @@toStringTag
method constructor
method createWritable
method createWriter
method getFile
interface FileSystemHandle
attribute @@toStringTag
......
......@@ -470,7 +470,6 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] attribute @@toStringTag
[Worker] method constructor
[Worker] method createWritable
[Worker] method createWriter
[Worker] method getFile
[Worker] interface FileSystemHandle
[Worker] attribute @@toStringTag
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment