Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File's structured serialization should serialize lastModified attribute
https://bugs.webkit.org/show_bug.cgi?id=185773 Reviewed by Youenn Fablet. LayoutTests/imported/w3c: Re-sync workers/semantics/structured-clone WPT tests after: web-platform-tests/wpt#9218 * web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js: Added. (runStructuredCloneBatteryOfTests): * web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js: Added. (structuredCloneBatteryOfTests.push.async.f): * web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/common.js. (async.compare_Blob): (get_canvas_1x1_transparent_black): (get_canvas_1x1_non_transparent_non_black): (compare_ImageBitmap): (structuredCloneBatteryOfTests.push.async.f): * web-platform-tests/html/webappapis/structured-clone/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/w3c-import.log. * web-platform-tests/workers/semantics/structured-clone/dedicated-expected.txt: * web-platform-tests/workers/semantics/structured-clone/dedicated.html: * web-platform-tests/workers/semantics/structured-clone/dedicated.js: Removed. * web-platform-tests/workers/semantics/structured-clone/shared-expected.txt: * web-platform-tests/workers/semantics/structured-clone/shared.html: * web-platform-tests/workers/semantics/structured-clone/shared.js: Removed. * web-platform-tests/workers/semantics/structured-clone/w3c-import.log: * web-platform-tests/workers/semantics/structured-clone/worker-common.js: Removed. Source/WebCore: Update our implementation for the stuctured serialization of a File to include its lastModified attribute, as per: - https://w3c.github.io/FileAPI/#file-section No new tests, rebaselined existing test. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::write): (WebCore::CloneDeserializer::readFile): * fileapi/File.cpp: (WebCore::File::File): * fileapi/File.h: LayoutTests: Unskip structured serialization tests that no longer fail / time out. * TestExpectations: Canonical link: https://commits.webkit.org/201299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
21 changed files
with
435 additions
and
1,387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...tform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Runs a collection of tests that determine if an API implements structured clone | ||
* correctly. | ||
* | ||
* The `runner` parameter has the following properties: | ||
* - `setup()`: An optional function run once before testing starts | ||
* - `teardown()`: An option function run once after all tests are done | ||
* - `preTest()`: An optional, async function run before a test | ||
* - `postTest()`: An optional, async function run after a test is done | ||
* - `structuredClone(obj, transferList)`: Required function that somehow | ||
* structurally clones an object. | ||
* - `noTransferTests`: When true, disables tests with transferables | ||
*/ | ||
|
||
function runStructuredCloneBatteryOfTests(runner) { | ||
const defaultRunner = { | ||
setup() {}, | ||
preTest() {}, | ||
postTest() {}, | ||
teardown() {} | ||
}; | ||
runner = Object.assign({}, defaultRunner, runner); | ||
|
||
let setupPromise = runner.setup(); | ||
const allTests = structuredCloneBatteryOfTests.map(test => { | ||
|
||
return new Promise(resolve => { | ||
promise_test(async _ => { | ||
test = await test; | ||
await setupPromise; | ||
await runner.preTest(test); | ||
await test.f(runner) | ||
await runner.postTest(test); | ||
resolve(); | ||
}, test.description); | ||
}).catch(_ => {}); | ||
}); | ||
Promise.all(allTests).then(_ => runner.teardown()); | ||
} |
Oops, something went wrong.