Changeset 232043 in webkit
- Timestamp:
- May 21, 2018 7:24:18 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 deleted
- 14 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r232041 r232043 1 2018-05-21 Chris Dumez <cdumez@apple.com> 2 3 File's structured serialization should serialize lastModified attribute 4 https://bugs.webkit.org/show_bug.cgi?id=185773 5 6 Reviewed by Youenn Fablet. 7 8 Unskip structured serialization tests that no longer fail / time out. 9 10 * TestExpectations: 11 1 12 2018-05-21 Jiewen Tan <jiewen_tan@apple.com> 2 13 -
trunk/LayoutTests/TestExpectations
r232037 r232043 242 242 imported/w3c/web-platform-tests/workers/opaque-origin.html [ Skip ] 243 243 imported/w3c/web-platform-tests/workers/semantics/interface-objects/003.html [ Skip ] 244 imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared.html [ Skip ]245 imported/w3c/web-platform-tests/workers/semantics/structured-clone/dedicated.html [ Skip ]246 244 imported/w3c/web-platform-tests/workers/semantics/multiple-workers/003.html [ Skip ] 247 245 imported/w3c/web-platform-tests/workers/semantics/multiple-workers/005.html [ Skip ] -
trunk/LayoutTests/fast/storage/serialized-script-value.html
r232037 r232043 6 6 <body> 7 7 <script> 8 9 const currentVersion = 0x07; 8 10 9 11 // Here's a little Q&D helper for future adventurers needing to rebaseline this. … … 44 46 testSerialization({foo: 'zoo', bar: {baz: 'myNewKey'}}, 45 47 [ 46 0x06, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,48 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 47 49 0x80, 0x66, 0x6f, 0x6f, 0x10, 0x03, 0x00, 0x00, 48 50 0x80, 0x7a, 0x6f, 0x6f, 0x03, 0x00, 0x00, 0x80, … … 67 69 testSerialization({foo: 'zoo', bar: 'myNewKey'}, 68 70 [ 69 0x06, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,71 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 70 72 0x80, 0x66, 0x6f, 0x6f, 0x10, 0x03, 0x00, 0x00, 71 73 0x80, 0x7a, 0x6f, 0x6f, 0x03, 0x00, 0x00, 0x80, … … 75 77 ], 76 78 [ 77 0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,79 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 78 80 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10, 79 81 0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00, … … 87 89 testSerialization([], 88 90 [ 89 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,91 currentVersion, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 90 92 0x00, 0xff, 0xff, 0xff, 0xff 91 93 ], … … 96 98 testSerialization({foo: "zoo"}, 97 99 [ 98 0x06, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,100 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 99 101 0x80, 0x66, 0x6f, 0x6f, 0x10, 0x03, 0x00, 0x00, 100 102 0x80, 0x7a, 0x6f, 0x6f, 0xff, 0xff, 0xff, 0xff … … 108 110 testSerialization({foo: null}, 109 111 [ 110 0x06, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,112 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 111 113 0x80, 0x66, 0x6f, 0x6f, 0x04, 0xff, 0xff, 0xff, 112 114 0xff … … 120 122 testSerialization({}, 121 123 [ 122 0x06, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff,124 currentVersion, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, 123 125 0xff 124 126 ], … … 130 132 testSerialization(undefined, 131 133 [ 132 0x06, 0x00, 0x00, 0x00, 0x03134 currentVersion, 0x00, 0x00, 0x00, 0x03 133 135 ], 134 136 [ … … 137 139 testSerialization(true, 138 140 [ 139 0x06, 0x00, 0x00, 0x00, 0x09141 currentVersion, 0x00, 0x00, 0x00, 0x09 140 142 ], 141 143 [ … … 144 146 testSerialization(false, 145 147 [ 146 0x06, 0x00, 0x00, 0x00, 0x08148 currentVersion, 0x00, 0x00, 0x00, 0x08 147 149 ], 148 150 [ … … 151 153 testSerialization(new Array(100), 152 154 [ 153 0x06, 0x00, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00,155 currentVersion, 0x00, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 154 156 0x00, 0xff, 0xff, 0xff, 0xff 155 157 ], … … 160 162 testSerialization(10, 161 163 [ 162 0x06, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00,164 currentVersion, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, 163 165 0x00 164 166 ], … … 169 171 testSerialization(-10, 170 172 [ 171 0x06, 0x00, 0x00, 0x00, 0x05, 0xf6, 0xff, 0xff,173 currentVersion, 0x00, 0x00, 0x00, 0x05, 0xf6, 0xff, 0xff, 172 174 0xff 173 175 ], … … 178 180 testSerialization(Math.pow(2,30), 179 181 [ 180 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,182 currentVersion, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 181 183 0x40 182 184 ], … … 187 189 testSerialization(Math.pow(2,55), 188 190 [ 189 0x06, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,191 currentVersion, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 190 192 0x00, 0x00, 0x00, 0x60, 0x43, 191 193 ], … … 196 198 testSerialization(1.23, 197 199 [ 198 0x06, 0x00, 0x00, 0x00, 0x0a, 0xae, 0x47, 0xe1,200 currentVersion, 0x00, 0x00, 0x00, 0x0a, 0xae, 0x47, 0xe1, 199 201 0x7a, 0x14, 0xae, 0xf3, 0x3f 200 202 ], … … 205 207 testSerialization("", 206 208 [ 207 0x06, 0x00, 0x00, 0x00, 0x11209 currentVersion, 0x00, 0x00, 0x00, 0x11 208 210 ], 209 211 [ … … 212 214 testSerialization("abc", 213 215 [ 214 0x06, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00,216 currentVersion, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 215 217 0x80, 0x61, 0x62, 0x63 216 218 ], … … 221 223 testSerialization({integer: 123}, 222 224 [ 223 0x06, 0x00, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00,225 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00, 224 226 0x80, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 225 227 0x05, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, … … 234 236 testSerialization({string: "str"}, 235 237 [ 236 0x06, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00,238 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 237 239 0x80, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x10, 238 240 0x03, 0x00, 0x00, 0x80, 0x73, 0x74, 0x72, 0xff, … … 248 250 testSerialization({list: [1,2,3]}, 249 251 [ 250 0x06, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00,252 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 251 253 0x80, 0x6c, 0x69, 0x73, 0x74, 0x01, 0x03, 0x00, 252 254 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x01, … … 267 269 testSerialization(null, 268 270 [ 269 0x06, 0x00, 0x00, 0x00, 0x04271 currentVersion, 0x00, 0x00, 0x00, 0x04 270 272 ], 271 273 [ … … 274 276 testSerialization(/abc/, 275 277 [ 276 0x06, 0x00, 0x00, 0x00, 0x12, 0x03, 0x00, 0x00,278 currentVersion, 0x00, 0x00, 0x00, 0x12, 0x03, 0x00, 0x00, 277 279 0x80, 0x61, 0x62, 0x63, 0x00, 0x00, 0x00, 0x80 278 280 ], … … 288 290 testSerialization(outerObject, 289 291 [ 290 0x06, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,292 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 291 293 0x80, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x02, 0x05, 292 294 0x00, 0x00, 0x80, 0x68, 0x65, 0x6c, 0x6c, 0x6f, … … 310 312 testSerialization(innerObject, 311 313 [ 312 0x06, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,314 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 313 315 0x80, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x10, 0x05, 314 316 0x00, 0x00, 0x80, 0x74, 0x68, 0x65, 0x72, 0x65, … … 326 328 testSerialization(unicodeObject, 327 329 [ 328 0x06, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,330 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 329 331 0x80, 0x61, 0x10, 0xfe, 0xff, 0xff, 0xff, 0x00, 330 332 0x01, 0x00, 0x00, 0x80, 0x75, 0x10, 0x02, 0x00, … … 344 346 testSerialization(unicodeObject, 345 347 [ 346 0x06, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,348 currentVersion, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 347 349 0x80, 0x61, 0x10, 0x02, 0x00, 0x00, 0x80, 0x61, 348 350 0x62, 0x01, 0x00, 0x00, 0x80, 0x75, 0x10, 0x02, … … 369 371 testSerialization(arrayObject, 370 372 [ 371 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,373 currentVersion, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 372 374 0x00, 0xfd, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 373 375 0x80, 0x61, 0x09, 0x01, 0x00, 0x00, 0x80, 0x62, … … 383 385 testSerialization(arrayObject, 384 386 [ 385 0x06, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00,387 currentVersion, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 386 388 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 387 389 0x00, 0x80, 0x66, 0x6f, 0x6f, 0x01, 0x00, 0x00, … … 404 406 testSerialization(mapObject, 405 407 [ 406 0x06, 0x00, 0x00, 0x00, 0x1e, 0x07, 0x05, 0x02,408 currentVersion, 0x00, 0x00, 0x00, 0x1e, 0x07, 0x05, 0x02, 407 409 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 408 410 0x00, 0x00, 0xf8, 0x3f, 0x02, 0xff, 0xff, 0xff, … … 425 427 testSerialization(setObject, 426 428 [ 427 0x06, 0x00, 0x00, 0x00, 0x1d, 0x07, 0x0a, 0x00,429 currentVersion, 0x00, 0x00, 0x00, 0x1d, 0x07, 0x0a, 0x00, 428 430 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x13, 429 431 0x00, 0x10, 0x03, 0x00, 0x00, 0x80, 0x62, 0x61, -
trunk/LayoutTests/imported/w3c/ChangeLog
r232037 r232043 1 2018-05-21 Chris Dumez <cdumez@apple.com> 2 3 File's structured serialization should serialize lastModified attribute 4 https://bugs.webkit.org/show_bug.cgi?id=185773 5 6 Reviewed by Youenn Fablet. 7 8 Re-sync workers/semantics/structured-clone WPT tests after: 9 https://github.com/w3c/web-platform-tests/pull/9218 10 11 * web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js: Added. 12 (runStructuredCloneBatteryOfTests): 13 * web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js: Added. 14 (structuredCloneBatteryOfTests.push.async.f): 15 * 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. 16 (async.compare_Blob): 17 (get_canvas_1x1_transparent_black): 18 (get_canvas_1x1_non_transparent_non_black): 19 (compare_ImageBitmap): 20 (structuredCloneBatteryOfTests.push.async.f): 21 * 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. 22 * web-platform-tests/workers/semantics/structured-clone/dedicated-expected.txt: 23 * web-platform-tests/workers/semantics/structured-clone/dedicated.html: 24 * web-platform-tests/workers/semantics/structured-clone/dedicated.js: Removed. 25 * web-platform-tests/workers/semantics/structured-clone/shared-expected.txt: 26 * web-platform-tests/workers/semantics/structured-clone/shared.html: 27 * web-platform-tests/workers/semantics/structured-clone/shared.js: Removed. 28 * web-platform-tests/workers/semantics/structured-clone/w3c-import.log: 29 * web-platform-tests/workers/semantics/structured-clone/worker-common.js: Removed. 30 1 31 2018-05-21 Commit Queue <commit-queue@webkit.org> 2 32 -
trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/keypath-special-identifiers-expected.txt
r232037 r232043 5 5 PASS Type: Blob, identifier: type 6 6 PASS Type: File, identifier: name 7 FAIL Type: File, identifier: lastModified assert_equals: Property should be used as key expected 0 but got 1 7 PASS Type: File, identifier: lastModified 8 8 FAIL Type: File, identifier: lastModifiedDate Provided data is inadequate. 9 9 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests.js
r232042 r232043 1 function createWorker(msg) { 2 // `type` is defined in the test case itself 3 if (type == 'dedicated') 4 return new Worker('dedicated.js#'+encodeURIComponent(msg)); 5 else if (type == 'shared') 6 return (new SharedWorker('shared.js#'+encodeURIComponent(msg))).port; 7 else 8 assert_unreached('invalid or missing `type`'); 9 } 10 11 function check(msg, input, callback, test_obj) { 12 if (!test_obj) 13 test_obj = async_test(msg); 14 test_obj.step(function() { 15 var w = createWorker(msg); 16 if (typeof input === 'function') 17 input = this.step(input); 18 w.postMessage(input); 19 w.onmessage = this.step_func(function(ev) { callback(ev.data, input, this); }); 1 /* This file is mostly a remix of @zcorpan’s web worker test suite */ 2 3 structuredCloneBatteryOfTests = []; 4 5 function check(description, input, callback) { 6 testObjMock = { 7 done() {}, 8 step_func(f) {return _ => f()}, 9 }; 10 11 structuredCloneBatteryOfTests.push({ 12 description, 13 async f(runner) { 14 let newInput = input; 15 if (typeof input === 'function') { 16 newInput = input(); 17 } 18 const copy = await runner.structuredClone(newInput); 19 await callback(copy, newInput, testObjMock); 20 } 20 21 }); 21 22 } … … 262 263 check('Object RegExp object, RegExp new line', {'x':new RegExp('\n')}, compare_Object(enumerate_props(compare_RegExp('\\n')))); 263 264 264 function compare_Blob(actual, input, test_obj, expect_File) {265 async function compare_Blob(actual, input, test_obj, expect_File) { 265 266 if (typeof actual === 'string') 266 267 assert_unreached(actual); … … 271 272 assert_equals(actual.type, input.type, 'type'); 272 273 assert_not_equals(actual, input); 273 var ev_reader = new FileReader(); 274 var input_reader = new FileReader(); 275 var read_count = 0; 276 var read_done = test_obj.step_func(function() { 277 read_count++; 278 if (read_count == 2) { 279 var ev_result = ev_reader.result; 280 var input_result = input_reader.result; 281 assert_equals(ev_result.byteLength, input_result.byteLength, 'byteLength'); 282 var ev_view = new DataView(ev_result); 283 var input_view = new DataView(input_result); 284 for (var i = 0; i < ev_result.byteLength; ++i) { 285 assert_equals(ev_view.getUint8(i), input_view.getUint8(i), 'getUint8('+i+')'); 286 } 287 if (test_obj) 288 test_obj.done(); 289 } 290 }); 291 var read_error = test_obj.step_func(function() { assert_unreached('FileReader error'); }); 292 ev_reader.readAsArrayBuffer(actual); 293 ev_reader.onload = read_done; 294 ev_reader.onabort = ev_reader.onerror = read_error; 295 input_reader.readAsArrayBuffer(input); 296 input_reader.onload = read_done; 297 input_reader.onabort = input_reader.onerror = read_error; 274 const ab1 = new Response(actual).arrayBuffer(); 275 const ab2 = new Response(input).arrayBuffer(); 276 assert_equals(ab1.btyeLength, ab2.byteLength, 'byteLength'); 277 const ta1 = new Uint8Array(ab1); 278 const ta2 = new Uint8Array(ab2); 279 for(let i = 0; i < ta1.size; i++) { 280 assert_equals(ta1[i], ta2[i]); 281 } 298 282 } 299 283 function func_Blob_basic() { … … 339 323 check('Blob NUL', func_Blob_NUL, compare_Blob); 340 324 341 async_test(function(test_obj) { 342 check(test_obj.name, [test_obj.step(func_Blob_basic)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); 343 }, 'Array Blob object, Blob basic'); 344 async_test(function(test_obj) { 345 check(test_obj.name, [test_obj.step(func_Blob_bytes([0xD800]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); 346 }, 'Array Blob object, Blob unpaired high surrogate (invalid utf-8)'); 347 async_test(function(test_obj) { 348 check(test_obj.name, [test_obj.step(func_Blob_bytes([0xDC00]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); 349 }, 'Array Blob object, Blob unpaired low surrogate (invalid utf-8)'); 350 async_test(function(test_obj) { 351 check(test_obj.name, [test_obj.step(func_Blob_bytes([0xD800, 0xDC00]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); 352 }, 'Array Blob object, Blob paired surrogates (invalid utf-8)'); 353 async_test(function(test_obj) { 354 check(test_obj.name, [test_obj.step(func_Blob_empty)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); 355 }, 'Array Blob object, Blob empty'); 356 async_test(function(test_obj) { 357 check(test_obj.name, [test_obj.step(func_Blob_NUL)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); 358 }, 'Array Blob object, Blob NUL'); 359 360 async_test(function(test_obj) { 361 check(test_obj.name, {'x':test_obj.step(func_Blob_basic)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); 362 }, 'Object Blob object, Blob basic'); 363 async_test(function(test_obj) { 364 check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xD800]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); 365 }, 'Object Blob object, Blob unpaired high surrogate (invalid utf-8)'); 366 async_test(function(test_obj) { 367 check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xDC00]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); 368 }, 'Object Blob object, Blob unpaired low surrogate (invalid utf-8)'); 369 async_test(function(test_obj) { 370 check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xD800, 0xDC00]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); 371 }, 'Object Blob object, Blob paired surrogates (invalid utf-8)'); 372 async_test(function(test_obj) { 373 check(test_obj.name, {'x':test_obj.step(func_Blob_empty)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); 374 }, 'Object Blob object, Blob empty'); 375 async_test(function(test_obj) { 376 check(test_obj.name, {'x':test_obj.step(func_Blob_NUL)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); 377 }, 'Object Blob object, Blob NUL'); 325 check('Array Blob object, Blob basic', [func_Blob_basic()], compare_Array(enumerate_props(compare_Blob), true)); 326 check('Array Blob object, Blob unpaired high surrogate (invalid utf-8)', [func_Blob_bytes([0xD800])()], compare_Array(enumerate_props(compare_Blob), true)); 327 check('Array Blob object, Blob unpaired low surrogate (invalid utf-8)', [func_Blob_bytes([0xDC00])()], compare_Array(enumerate_props(compare_Blob), true)); 328 check('Array Blob object, Blob paired surrogates (invalid utf-8)', [func_Blob_bytes([0xD800, 0xDC00])()], compare_Array(enumerate_props(compare_Blob), true)); 329 check('Array Blob object, Blob empty', [func_Blob_empty()], compare_Array(enumerate_props(compare_Blob), true)); 330 check('Array Blob object, Blob NUL', [func_Blob_NUL()], compare_Array(enumerate_props(compare_Blob), true)); 331 332 check('Object Blob object, Blob basic', {'x':func_Blob_basic()}, compare_Object(enumerate_props(compare_Blob), true)); 333 check('Object Blob object, Blob unpaired high surrogate (invalid utf-8)', {'x':func_Blob_bytes([0xD800])()}, compare_Object(enumerate_props(compare_Blob), true)); 334 check('Object Blob object, Blob unpaired low surrogate (invalid utf-8)', {'x':func_Blob_bytes([0xDC00])()}, compare_Object(enumerate_props(compare_Blob), true)); 335 check('Object Blob object, Blob paired surrogates (invalid utf-8)', {'x':func_Blob_bytes([0xD800, 0xDC00])() }, compare_Object(enumerate_props(compare_Blob), true)); 336 check('Object Blob object, Blob empty', {'x':func_Blob_empty()}, compare_Object(enumerate_props(compare_Blob), true)); 337 check('Object Blob object, Blob NUL', {'x':func_Blob_NUL()}, compare_Object(enumerate_props(compare_Blob), true)); 378 338 379 339 function compare_File(actual, input, test_obj) { … … 405 365 } 406 366 check('FileList empty', func_FileList_empty, compare_FileList); 407 check('Array FileList object, FileList empty', [func_FileList_empty ], compare_Array(enumerate_props(compare_FileList)));408 check('Object FileList object, FileList empty', {'x':func_FileList_empty }, compare_Object(enumerate_props(compare_FileList)));367 check('Array FileList object, FileList empty', [func_FileList_empty()], compare_Array(enumerate_props(compare_FileList))); 368 check('Object FileList object, FileList empty', {'x':func_FileList_empty()}, compare_Object(enumerate_props(compare_FileList))); 409 369 410 370 function compare_ArrayBufferView(view) { … … 450 410 } 451 411 check('ImageData 1x1 non-transparent non-black', func_ImageData_1x1_non_transparent_non_black, compare_ImageData); 452 async_test(function(test_obj) { 453 check(test_obj.name, [test_obj.step(func_ImageData_1x1_transparent_black)], compare_Array(enumerate_props(compare_ImageData)), test_obj); 454 }, 'Array ImageData object, ImageData 1x1 transparent black'); 455 async_test(function(test_obj) { 456 check(test_obj.name, [test_obj.step(func_ImageData_1x1_non_transparent_non_black)], compare_Array(enumerate_props(compare_ImageData)), test_obj); 457 }, 'Array ImageData object, ImageData 1x1 non-transparent non-black'); 458 async_test(function(test_obj) { 459 check(test_obj.name, {'x':test_obj.step(func_ImageData_1x1_transparent_black)}, compare_Object(enumerate_props(compare_ImageData)), test_obj); 460 }, 'Object ImageData object, ImageData 1x1 transparent black'); 461 async_test(function(test_obj) { 462 check(test_obj.name, {'x':test_obj.step(func_ImageData_1x1_non_transparent_non_black)}, compare_Object(enumerate_props(compare_ImageData)), test_obj); 463 }, 'Object ImageData object, ImageData 1x1 non-transparent non-black'); 464 465 function compare_ImageBitmap(actual, input, test_obj) { 466 if (typeof actual === 'string') 467 assert_unreached(actual); 468 assert_equals(actual instanceof ImageBitmap, 'instanceof ImageBitmap'); 469 assert_not_equals(actual, input); 470 // XXX paint the ImageBitmap on a canvas and check the data 471 if (test_obj) 472 test_obj.done(); 473 } 412 check('Array ImageData object, ImageData 1x1 transparent black', [func_ImageData_1x1_transparent_black()], compare_Array(enumerate_props(compare_ImageData))); 413 check('Array ImageData object, ImageData 1x1 non-transparent non-black', [func_ImageData_1x1_non_transparent_non_black()], compare_Array(enumerate_props(compare_ImageData))); 414 check('Object ImageData object, ImageData 1x1 transparent black', {'x':func_ImageData_1x1_transparent_black()}, compare_Object(enumerate_props(compare_ImageData))); 415 check('Object ImageData object, ImageData 1x1 non-transparent non-black', {'x':func_ImageData_1x1_non_transparent_non_black()}, compare_Object(enumerate_props(compare_ImageData))); 416 417 418 check('Array sparse', new Array(10), compare_Array(enumerate_props(compare_primitive))); 419 check('Array with non-index property', function() { 420 var rv = []; 421 rv.foo = 'bar'; 422 return rv; 423 }, compare_Array(enumerate_props(compare_primitive))); 424 check('Object with index property and length', {'0':'foo', 'length':1}, compare_Object(enumerate_props(compare_primitive))); 425 function check_circular_property(prop) { 426 return function(actual) { 427 assert_equals(actual[prop], actual); 428 }; 429 } 430 check('Array with circular reference', function() { 431 var rv = []; 432 rv[0] = rv; 433 return rv; 434 }, compare_Array(check_circular_property('0'))); 435 check('Object with circular reference', function() { 436 var rv = {}; 437 rv['x'] = rv; 438 return rv; 439 }, compare_Object(check_circular_property('x'))); 440 function check_identical_property_values(prop1, prop2) { 441 return function(actual) { 442 assert_equals(actual[prop1], actual[prop2]); 443 }; 444 } 445 check('Array with identical property values', function() { 446 var obj = {} 447 return [obj, obj]; 448 }, compare_Array(check_identical_property_values('0', '1'))); 449 check('Object with identical property values', function() { 450 var obj = {} 451 return {'x':obj, 'y':obj}; 452 }, compare_Object(check_identical_property_values('x', 'y'))); 453 454 function check_absent_property(prop) { 455 return function(actual) { 456 assert_false(prop in actual); 457 }; 458 } 459 check('Object with property on prototype', function() { 460 var Foo = function() {}; 461 Foo.prototype = {'foo':'bar'}; 462 return new Foo(); 463 }, compare_Object(check_absent_property('foo'))); 464 465 check('Object with non-enumerable property', function() { 466 var rv = {}; 467 Object.defineProperty(rv, 'foo', {value:'bar', enumerable:false, writable:true, configurable:true}); 468 return rv; 469 }, compare_Object(check_absent_property('foo'))); 470 471 function check_writable_property(prop) { 472 return function(actual, input) { 473 assert_equals(actual[prop], input[prop]); 474 actual[prop] += ' baz'; 475 assert_equals(actual[prop], input[prop] + ' baz'); 476 }; 477 } 478 check('Object with non-writable property', function() { 479 var rv = {}; 480 Object.defineProperty(rv, 'foo', {value:'bar', enumerable:true, writable:false, configurable:true}); 481 return rv; 482 }, compare_Object(check_writable_property('foo'))); 483 484 function check_configurable_property(prop) { 485 return function(actual, input) { 486 assert_equals(actual[prop], input[prop]); 487 delete actual[prop]; 488 assert_false('prop' in actual); 489 }; 490 } 491 check('Object with non-configurable property', function() { 492 var rv = {}; 493 Object.defineProperty(rv, 'foo', {value:'bar', enumerable:true, writable:true, configurable:false}); 494 return rv; 495 }, compare_Object(check_configurable_property('foo'))); 496 497 /* The tests below are inspired by @zcorpan’s work but got some 498 more substantial changed due to their previous async setup */ 499 474 500 function get_canvas_1x1_transparent_black() { 475 501 var canvas = document.createElement('canvas'); … … 478 504 return canvas; 479 505 } 480 async_test(function(test_obj) { 481 var canvas = get_canvas_1x1_transparent_black(); 482 createImageBitmap(canvas, function(image) { check(test_obj.name, image, compare_ImageBitmap, test_obj); }); 483 }, 'ImageBitmap 1x1 transparent black'); 506 484 507 function get_canvas_1x1_non_transparent_non_black() { 485 508 var canvas = document.createElement('canvas'); … … 494 517 return canvas; 495 518 } 496 async_test(function(test_obj) { 497 var canvas = get_canvas_1x1_non_transparent_non_black(); 498 createImageBitmap(canvas, function(image) { check(test_obj.name, image, compare_ImageBitmap, test_obj); }); 499 }, 'ImageBitmap 1x1 non-transparent non-black'); 500 501 async_test(function(test_obj) { 502 var canvas = get_canvas_1x1_transparent_black(); 503 createImageBitmap(canvas, function(image) { check(test_obj.name, [image], compare_Array(enumerate_props(compare_ImageBitmap)), test_obj); }); 504 }, 'Array ImageBitmap object, ImageBitmap 1x1 transparent black'); 505 async_test(function(test_obj) { 506 var canvas = get_canvas_1x1_non_transparent_non_black(); 507 createImageBitmap(canvas, function(image) { check(test_obj.name, [image], compare_Array(enumerate_props(compare_ImageBitmap)), test_obj); }); 508 }, 'Array ImageBitmap object, ImageBitmap 1x1 non-transparent non-black'); 509 510 async_test(function(test_obj) { 511 var canvas = get_canvas_1x1_transparent_black(); 512 createImageBitmap(canvas, function(image) { check(test_obj.name, {'x':image}, compare_Object(enumerate_props(compare_ImageBitmap)), test_obj); }); 513 }, 'Object ImageBitmap object, ImageBitmap 1x1 transparent black'); 514 async_test(function(test_obj) { 515 var canvas = get_canvas_1x1_non_transparent_non_black(); 516 createImageBitmap(canvas, function(image) { check(test_obj.name, {'x':image}, compare_Object(enumerate_props(compare_ImageBitmap)), test_obj); }); 517 }, 'Object ImageBitmap object, ImageBitmap 1x1 non-transparent non-black'); 518 519 check('Array sparse', new Array(10), compare_Array(enumerate_props(compare_primitive))); 520 check('Array with non-index property', function() { 521 var rv = []; 522 rv.foo = 'bar'; 523 return rv; 524 }, compare_Array(enumerate_props(compare_primitive))); 525 check('Object with index property and length', {'0':'foo', 'length':1}, compare_Object(enumerate_props(compare_primitive))); 526 function check_circular_property(prop) { 527 return function(actual) { 528 assert_equals(actual[prop], actual); 529 }; 530 } 531 check('Array with circular reference', function() { 532 var rv = []; 533 rv[0] = rv; 534 return rv; 535 }, compare_Array(check_circular_property('0'))); 536 check('Object with circular reference', function() { 537 var rv = {}; 538 rv['x'] = rv; 539 return rv; 540 }, compare_Object(check_circular_property('x'))); 541 function check_identical_property_values(prop1, prop2) { 542 return function(actual) { 543 assert_equals(actual[prop1], actual[prop2]); 544 }; 545 } 546 check('Array with identical property values', function() { 547 var obj = {} 548 return [obj, obj]; 549 }, compare_Array(check_identical_property_values('0', '1'))); 550 check('Object with identical property values', function() { 551 var obj = {} 552 return {'x':obj, 'y':obj}; 553 }, compare_Object(check_identical_property_values('x', 'y'))); 554 555 function check_absent_property(prop) { 556 return function(actual) { 557 assert_false(prop in actual); 558 }; 559 } 560 check('Object with property on prototype', function() { 561 var Foo = function() {}; 562 Foo.prototype = {'foo':'bar'}; 563 return new Foo(); 564 }, compare_Object(check_absent_property('foo'))); 565 566 check('Object with non-enumerable property', function() { 567 var rv = {}; 568 Object.defineProperty(rv, 'foo', {value:'bar', enumerable:false, writable:true, configurable:true}); 569 return rv; 570 }, compare_Object(check_absent_property('foo'))); 571 572 function check_writable_property(prop) { 573 return function(actual, input) { 574 assert_equals(actual[prop], input[prop]); 575 actual[prop] += ' baz'; 576 assert_equals(actual[prop], input[prop] + ' baz'); 577 }; 578 } 579 check('Object with non-writable property', function() { 580 var rv = {}; 581 Object.defineProperty(rv, 'foo', {value:'bar', enumerable:true, writable:false, configurable:true}); 582 return rv; 583 }, compare_Object(check_writable_property('foo'))); 584 585 function check_configurable_property(prop) { 586 return function(actual, input) { 587 assert_equals(actual[prop], input[prop]); 588 delete actual[prop]; 589 assert_false('prop' in actual); 590 }; 591 } 592 check('Object with non-configurable property', function() { 593 var rv = {}; 594 Object.defineProperty(rv, 'foo', {value:'bar', enumerable:true, writable:true, configurable:false}); 595 return rv; 596 }, compare_Object(check_configurable_property('foo'))); 519 520 function compare_ImageBitmap(actual, input) { 521 if (typeof actual === 'string') 522 assert_unreached(actual); 523 assert_true(actual instanceof ImageBitmap, 'instanceof ImageBitmap'); 524 assert_not_equals(actual, input); 525 // XXX paint the ImageBitmap on a canvas and check the data 526 } 527 528 structuredCloneBatteryOfTests.push({ 529 description: 'ImageBitmap 1x1 transparent black', 530 async f(runner) { 531 var canvas = get_canvas_1x1_transparent_black(); 532 const bm = await createImageBitmap(canvas); 533 const copy = await runner.structuredClone(bm); 534 compare_ImageBitmap(bm, copy); 535 } 536 }); 537 538 structuredCloneBatteryOfTests.push({ 539 description: 'ImageBitmap 1x1 non-transparent non-black', 540 async f(runner) { 541 var canvas = get_canvas_1x1_non_transparent_non_black(); 542 const bm = await createImageBitmap(canvas); 543 const copy = await runner.structuredClone(bm); 544 compare_ImageBitmap(bm, copy); 545 } 546 }); 547 548 structuredCloneBatteryOfTests.push({ 549 description: 'Array ImageBitmap object, ImageBitmap 1x1 transparent black', 550 async f(runner) { 551 var canvas = get_canvas_1x1_transparent_black(); 552 const bm = [await createImageBitmap(canvas)]; 553 const copy = await runner.structuredClone(bm); 554 compare_Array(enumerate_props(compare_ImageBitmap))(bm, copy); 555 } 556 }); 557 558 structuredCloneBatteryOfTests.push({ 559 description: 'Array ImageBitmap object, ImageBitmap 1x1 transparent non-black', 560 async f(runner) { 561 var canvas = get_canvas_1x1_non_transparent_non_black(); 562 const bm = [await createImageBitmap(canvas)]; 563 const copy = await runner.structuredClone(bm); 564 compare_Array(enumerate_props(compare_ImageBitmap))(bm, copy); 565 } 566 }); 567 568 structuredCloneBatteryOfTests.push({ 569 description: 'Object ImageBitmap object, ImageBitmap 1x1 transparent black', 570 async f(runner) { 571 var canvas = get_canvas_1x1_transparent_black(); 572 const bm = {x: await createImageBitmap(canvas)}; 573 const copy = await runner.structuredClone(bm); 574 compare_Object(enumerate_props(compare_ImageBitmap))(bm, copy); 575 } 576 }); 577 578 structuredCloneBatteryOfTests.push({ 579 description: 'Object ImageBitmap object, ImageBitmap 1x1 transparent non-black', 580 async f(runner) { 581 var canvas = get_canvas_1x1_non_transparent_non_black(); 582 const bm = {x: await createImageBitmap(canvas)}; 583 const copy = await runner.structuredClone(bm); 584 compare_Object(enumerate_props(compare_ImageBitmap))(bm, copy); 585 } 586 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/structured-clone/w3c-import.log
r232042 r232043 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/common.js 18 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/dedicated.html 19 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/dedicated.js 20 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared.html 21 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared.js 22 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/worker-common.js 17 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js 18 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js 19 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/structured-clone/structured-clone-battery-of-tests.js -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/dedicated-expected.txt
r232037 r232043 1 2 Harness Error (TIMEOUT), message = null3 1 4 2 PASS primitive undefined … … 53 51 PASS Object Date objects 54 52 PASS RegExp flags and lastIndex 55 FAIL RegExp sticky flag assert_ unreached: FAIL: unknown test Reached unreachable code56 FAIL RegExp unicode flag assert_ unreached: FAIL: unknown test Reached unreachable code53 FAIL RegExp sticky flag assert_equals: sticky expected true but got false 54 FAIL RegExp unicode flag assert_equals: unicode expected true but got false 57 55 PASS RegExp empty 58 56 PASS RegExp slash 59 57 PASS RegExp new line 60 58 PASS Array RegExp object, RegExp flags and lastIndex 61 FAIL Array RegExp object, RegExp sticky flag assert_ unreached: FAIL: unknown test Reached unreachable code62 FAIL Array RegExp object, RegExp unicode flag assert_ unreached: FAIL: unknown test Reached unreachable code59 FAIL Array RegExp object, RegExp sticky flag assert_equals: sticky expected true but got false 60 FAIL Array RegExp object, RegExp unicode flag assert_equals: unicode expected true but got false 63 61 PASS Array RegExp object, RegExp empty 64 62 PASS Array RegExp object, RegExp slash 65 63 PASS Array RegExp object, RegExp new line 66 64 PASS Object RegExp object, RegExp flags and lastIndex 67 FAIL Object RegExp object, RegExp sticky flag assert_ unreached: FAIL: unknown test Reached unreachable code68 FAIL Object RegExp object, RegExp unicode flag assert_ unreached: FAIL: unknown test Reached unreachable code65 FAIL Object RegExp object, RegExp sticky flag assert_equals: sticky expected true but got false 66 FAIL Object RegExp object, RegExp unicode flag assert_equals: unicode expected true but got false 69 67 PASS Object RegExp object, RegExp empty 70 68 PASS Object RegExp object, RegExp slash 71 69 PASS Object RegExp object, RegExp new line 72 FAIL Blob basic assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 73 FAIL Blob unpaired high surrogate (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 74 FAIL Blob unpaired low surrogate (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 75 FAIL Blob paired surrogates (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 76 FAIL Blob empty assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 77 FAIL Blob NUL assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 78 FAIL Array Blob object, Blob basic assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 79 FAIL Array Blob object, Blob unpaired high surrogate (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 80 FAIL Array Blob object, Blob unpaired low surrogate (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 81 FAIL Array Blob object, Blob paired surrogates (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 82 FAIL Array Blob object, Blob empty assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 83 FAIL Array Blob object, Blob NUL assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 84 FAIL Object Blob object, Blob basic assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 85 FAIL Object Blob object, Blob unpaired high surrogate (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 86 FAIL Object Blob object, Blob unpaired low surrogate (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 87 FAIL Object Blob object, Blob paired surrogates (invalid utf-8) assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 88 FAIL Object Blob object, Blob empty assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 89 FAIL Object Blob object, Blob NUL assert_unreached: FAIL ReferenceError: Can't find variable: File Reached unreachable code 90 FAIL File basic assert_true: instanceof File expected true got false 91 FAIL FileList empty assert_unreached: FAIL ReferenceError: Can't find variable: FileList Reached unreachable code 92 FAIL Array FileList object, FileList empty The object can not be cloned. 93 FAIL Object FileList object, FileList empty The object can not be cloned. 70 PASS Blob basic 71 PASS Blob unpaired high surrogate (invalid utf-8) 72 PASS Blob unpaired low surrogate (invalid utf-8) 73 PASS Blob paired surrogates (invalid utf-8) 74 PASS Blob empty 75 PASS Blob NUL 76 PASS Array Blob object, Blob basic 77 PASS Array Blob object, Blob unpaired high surrogate (invalid utf-8) 78 PASS Array Blob object, Blob unpaired low surrogate (invalid utf-8) 79 PASS Array Blob object, Blob paired surrogates (invalid utf-8) 80 PASS Array Blob object, Blob empty 81 PASS Array Blob object, Blob NUL 82 PASS Object Blob object, Blob basic 83 PASS Object Blob object, Blob unpaired high surrogate (invalid utf-8) 84 PASS Object Blob object, Blob unpaired low surrogate (invalid utf-8) 85 PASS Object Blob object, Blob paired surrogates (invalid utf-8) 86 PASS Object Blob object, Blob empty 87 PASS Object Blob object, Blob NUL 88 PASS File basic 89 PASS FileList empty 90 PASS Array FileList object, FileList empty 91 PASS Object FileList object, FileList empty 94 92 PASS ImageData 1x1 transparent black 95 93 PASS ImageData 1x1 non-transparent non-black … … 98 96 PASS Object ImageData object, ImageData 1x1 transparent black 99 97 PASS Object ImageData object, ImageData 1x1 non-transparent non-black 100 TIMEOUT ImageBitmap 1x1 transparent black Test timed out101 TIMEOUT ImageBitmap 1x1 non-transparent non-black Test timed out102 TIMEOUT Array ImageBitmap object, ImageBitmap 1x1 transparent black Test timed out103 TIMEOUT Array ImageBitmap object, ImageBitmap 1x1 non-transparent non-black Test timed out104 TIMEOUT Object ImageBitmap object, ImageBitmap 1x1 transparent black Test timed out105 TIMEOUT Object ImageBitmap object, ImageBitmap 1x1 non-transparent non-black Test timed out106 98 PASS Array sparse 107 99 PASS Array with non-index property … … 115 107 PASS Object with non-writable property 116 108 PASS Object with non-configurable property 109 FAIL ImageBitmap 1x1 transparent black promise_test: Unhandled rejection with value: object "TypeError: Type error" 110 FAIL ImageBitmap 1x1 non-transparent non-black promise_test: Unhandled rejection with value: object "TypeError: Type error" 111 FAIL Array ImageBitmap object, ImageBitmap 1x1 transparent black promise_test: Unhandled rejection with value: object "TypeError: Type error" 112 FAIL Array ImageBitmap object, ImageBitmap 1x1 transparent non-black promise_test: Unhandled rejection with value: object "TypeError: Type error" 113 FAIL Object ImageBitmap object, ImageBitmap 1x1 transparent black promise_test: Unhandled rejection with value: object "TypeError: Type error" 114 FAIL Object ImageBitmap object, ImageBitmap 1x1 transparent non-black promise_test: Unhandled rejection with value: object "TypeError: Type error" 115 PASS ArrayBuffer 116 PASS MessagePort 117 117 -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/dedicated.html
r232037 r232043 3 3 <script src="/resources/testharness.js"></script> 4 4 <script src="/resources/testharnessreport.js"></script> 5 <script src=/html/webappapis/structured-clone/structured-clone-battery-of-tests.js></script> 6 <script src=/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js></script> 7 <script src=/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js></script> 5 8 <div id=log></div> 6 9 <script> 7 var type = 'dedicated'; 10 runStructuredCloneBatteryOfTests({ 11 setup() { 12 const blob = new Blob([` 13 onmessage = ev => postMessage(ev.data, ev.data.transfer); 14 `], {type: 'text/javascript'}); 15 this.blobURL = URL.createObjectURL(blob); 16 this.worker = new Worker(this.blobURL); 17 }, 18 structuredClone(data, transfer) { 19 return new Promise(resolve => { 20 this.worker.addEventListener('message', function f(ev) { 21 this.worker.removeEventListener('message', f); 22 resolve(ev.data.data); 23 }.bind(this)); 24 this.worker.postMessage({data, transfer}, transfer); 25 }); 26 }, 27 teardown() { 28 this.worker.terminate(); 29 URL.revokeObjectURL(this.blobURL); 30 } 31 }); 8 32 </script> 9 <script src="common.js"></script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared-expected.txt
r232037 r232043 1 CONSOLE MESSAGE: line 19: ReferenceError: Can't find variable: SharedWorker 1 2 2 Harness Error (TIMEOUT), message = null 3 FAIL structured clone to shared worker ReferenceError: Can't find variable: SharedWorker 3 4 4 FAIL primitive undefined Can't find variable: SharedWorker5 FAIL primitive null Can't find variable: SharedWorker6 FAIL primitive true Can't find variable: SharedWorker7 FAIL primitive false Can't find variable: SharedWorker8 FAIL primitive string, empty string Can't find variable: SharedWorker9 FAIL primitive string, lone high surrogate Can't find variable: SharedWorker10 FAIL primitive string, lone low surrogate Can't find variable: SharedWorker11 FAIL primitive string, NUL Can't find variable: SharedWorker12 FAIL primitive string, astral character Can't find variable: SharedWorker13 FAIL primitive number, 0.2 Can't find variable: SharedWorker14 FAIL primitive number, 0 Can't find variable: SharedWorker15 FAIL primitive number, -0 Can't find variable: SharedWorker16 FAIL primitive number, NaN Can't find variable: SharedWorker17 FAIL primitive number, Infinity Can't find variable: SharedWorker18 FAIL primitive number, -Infinity Can't find variable: SharedWorker19 FAIL primitive number, 9007199254740992 Can't find variable: SharedWorker20 FAIL primitive number, -9007199254740992 Can't find variable: SharedWorker21 FAIL primitive number, 9007199254740994 Can't find variable: SharedWorker22 FAIL primitive number, -9007199254740994 Can't find variable: SharedWorker23 FAIL Array primitives Can't find variable: SharedWorker24 FAIL Object primitives Can't find variable: SharedWorker25 FAIL Boolean true Can't find variable: SharedWorker26 FAIL Boolean false Can't find variable: SharedWorker27 FAIL Array Boolean objects Can't find variable: SharedWorker28 FAIL Object Boolean objects Can't find variable: SharedWorker29 FAIL String empty string Can't find variable: SharedWorker30 FAIL String lone high surrogate Can't find variable: SharedWorker31 FAIL String lone low surrogate Can't find variable: SharedWorker32 FAIL String NUL Can't find variable: SharedWorker33 FAIL String astral character Can't find variable: SharedWorker34 FAIL Array String objects Can't find variable: SharedWorker35 FAIL Object String objects Can't find variable: SharedWorker36 FAIL Number 0.2 Can't find variable: SharedWorker37 FAIL Number 0 Can't find variable: SharedWorker38 FAIL Number -0 Can't find variable: SharedWorker39 FAIL Number NaN Can't find variable: SharedWorker40 FAIL Number Infinity Can't find variable: SharedWorker41 FAIL Number -Infinity Can't find variable: SharedWorker42 FAIL Number 9007199254740992 Can't find variable: SharedWorker43 FAIL Number -9007199254740992 Can't find variable: SharedWorker44 FAIL Number 9007199254740994 Can't find variable: SharedWorker45 FAIL Number -9007199254740994 Can't find variable: SharedWorker46 FAIL Array Number objects Can't find variable: SharedWorker47 FAIL Object Number objects Can't find variable: SharedWorker48 FAIL Date 0 Can't find variable: SharedWorker49 FAIL Date -0 Can't find variable: SharedWorker50 FAIL Date -8.64e15 Can't find variable: SharedWorker51 FAIL Date 8.64e15 Can't find variable: SharedWorker52 FAIL Array Date objects Can't find variable: SharedWorker53 FAIL Object Date objects Can't find variable: SharedWorker54 FAIL RegExp flags and lastIndex Can't find variable: SharedWorker55 FAIL RegExp sticky flag Can't find variable: SharedWorker56 FAIL RegExp unicode flag Can't find variable: SharedWorker57 FAIL RegExp empty Can't find variable: SharedWorker58 FAIL RegExp slash Can't find variable: SharedWorker59 FAIL RegExp new line Can't find variable: SharedWorker60 FAIL Array RegExp object, RegExp flags and lastIndex Can't find variable: SharedWorker61 FAIL Array RegExp object, RegExp sticky flag Can't find variable: SharedWorker62 FAIL Array RegExp object, RegExp unicode flag Can't find variable: SharedWorker63 FAIL Array RegExp object, RegExp empty Can't find variable: SharedWorker64 FAIL Array RegExp object, RegExp slash Can't find variable: SharedWorker65 FAIL Array RegExp object, RegExp new line Can't find variable: SharedWorker66 FAIL Object RegExp object, RegExp flags and lastIndex Can't find variable: SharedWorker67 FAIL Object RegExp object, RegExp sticky flag Can't find variable: SharedWorker68 FAIL Object RegExp object, RegExp unicode flag Can't find variable: SharedWorker69 FAIL Object RegExp object, RegExp empty Can't find variable: SharedWorker70 FAIL Object RegExp object, RegExp slash Can't find variable: SharedWorker71 FAIL Object RegExp object, RegExp new line Can't find variable: SharedWorker72 FAIL Blob basic Can't find variable: SharedWorker73 FAIL Blob unpaired high surrogate (invalid utf-8) Can't find variable: SharedWorker74 FAIL Blob unpaired low surrogate (invalid utf-8) Can't find variable: SharedWorker75 FAIL Blob paired surrogates (invalid utf-8) Can't find variable: SharedWorker76 FAIL Blob empty Can't find variable: SharedWorker77 FAIL Blob NUL Can't find variable: SharedWorker78 FAIL Array Blob object, Blob basic Can't find variable: SharedWorker79 FAIL Array Blob object, Blob unpaired high surrogate (invalid utf-8) Can't find variable: SharedWorker80 FAIL Array Blob object, Blob unpaired low surrogate (invalid utf-8) Can't find variable: SharedWorker81 FAIL Array Blob object, Blob paired surrogates (invalid utf-8) Can't find variable: SharedWorker82 FAIL Array Blob object, Blob empty Can't find variable: SharedWorker83 FAIL Array Blob object, Blob NUL Can't find variable: SharedWorker84 FAIL Object Blob object, Blob basic Can't find variable: SharedWorker85 FAIL Object Blob object, Blob unpaired high surrogate (invalid utf-8) Can't find variable: SharedWorker86 FAIL Object Blob object, Blob unpaired low surrogate (invalid utf-8) Can't find variable: SharedWorker87 FAIL Object Blob object, Blob paired surrogates (invalid utf-8) Can't find variable: SharedWorker88 FAIL Object Blob object, Blob empty Can't find variable: SharedWorker89 FAIL Object Blob object, Blob NUL Can't find variable: SharedWorker90 FAIL File basic Can't find variable: SharedWorker91 FAIL FileList empty Can't find variable: SharedWorker92 FAIL Array FileList object, FileList empty Can't find variable: SharedWorker93 FAIL Object FileList object, FileList empty Can't find variable: SharedWorker94 FAIL ImageData 1x1 transparent black Can't find variable: SharedWorker95 FAIL ImageData 1x1 non-transparent non-black Can't find variable: SharedWorker96 FAIL Array ImageData object, ImageData 1x1 transparent black Can't find variable: SharedWorker97 FAIL Array ImageData object, ImageData 1x1 non-transparent non-black Can't find variable: SharedWorker98 FAIL Object ImageData object, ImageData 1x1 transparent black Can't find variable: SharedWorker99 FAIL Object ImageData object, ImageData 1x1 non-transparent non-black Can't find variable: SharedWorker100 TIMEOUT ImageBitmap 1x1 transparent black Test timed out101 TIMEOUT ImageBitmap 1x1 non-transparent non-black Test timed out102 TIMEOUT Array ImageBitmap object, ImageBitmap 1x1 transparent black Test timed out103 TIMEOUT Array ImageBitmap object, ImageBitmap 1x1 non-transparent non-black Test timed out104 TIMEOUT Object ImageBitmap object, ImageBitmap 1x1 transparent black Test timed out105 TIMEOUT Object ImageBitmap object, ImageBitmap 1x1 non-transparent non-black Test timed out106 FAIL Array sparse Can't find variable: SharedWorker107 FAIL Array with non-index property Can't find variable: SharedWorker108 FAIL Object with index property and length Can't find variable: SharedWorker109 FAIL Array with circular reference Can't find variable: SharedWorker110 FAIL Object with circular reference Can't find variable: SharedWorker111 FAIL Array with identical property values Can't find variable: SharedWorker112 FAIL Object with identical property values Can't find variable: SharedWorker113 FAIL Object with property on prototype Can't find variable: SharedWorker114 FAIL Object with non-enumerable property Can't find variable: SharedWorker115 FAIL Object with non-writable property Can't find variable: SharedWorker116 FAIL Object with non-configurable property Can't find variable: SharedWorker117 -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared.html
r232037 r232043 3 3 <script src="/resources/testharness.js"></script> 4 4 <script src="/resources/testharnessreport.js"></script> 5 <script src=/html/webappapis/structured-clone/structured-clone-battery-of-tests.js></script> 6 <script src=/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js></script> 7 <script src=/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js></script> 5 8 <div id=log></div> 6 9 <script> 7 var type = 'shared'; 10 runStructuredCloneBatteryOfTests({ 11 setup() { 12 const blob = new Blob([` 13 onconnect = ev => { 14 const port = ev.ports[0]; 15 port.onmessage = ev => port.postMessage(ev.data, ev.data.transfer); 16 }; 17 `], {type: 'text/javascript'}); 18 this.blobURL = URL.createObjectURL(blob); 19 this.worker = new SharedWorker(this.blobURL); 20 this.port = this.worker.port; 21 }, 22 structuredClone(data, transfer) { 23 return new Promise(resolve => { 24 this.port.addEventListener('message', function f(ev) { 25 this.port.removeEventListener('message', f); 26 resolve(ev.data.data); 27 }.bind(this)); 28 this.port.start(); 29 this.port.postMessage({data, transfer}, transfer); 30 }); 31 }, 32 teardown() { 33 URL.revokeObjectURL(this.blobURL); 34 } 35 }); 8 36 </script> 9 <script src="common.js"></script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/w3c-import.log
r232037 r232043 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/common.js18 17 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/dedicated.html 19 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/dedicated.js20 18 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared.html 21 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared.js22 /LayoutTests/imported/w3c/web-platform-tests/workers/semantics/structured-clone/worker-common.js -
trunk/Source/WebCore/ChangeLog
r232042 r232043 1 2018-05-21 Chris Dumez <cdumez@apple.com> 2 3 File's structured serialization should serialize lastModified attribute 4 https://bugs.webkit.org/show_bug.cgi?id=185773 5 6 Reviewed by Youenn Fablet. 7 8 Update our implementation for the stuctured serialization of a File to include 9 its lastModified attribute, as per: 10 - https://w3c.github.io/FileAPI/#file-section 11 12 No new tests, rebaselined existing test. 13 14 * bindings/js/SerializedScriptValue.cpp: 15 (WebCore::CloneSerializer::write): 16 (WebCore::CloneDeserializer::readFile): 17 * fileapi/File.cpp: 18 (WebCore::File::File): 19 * fileapi/File.h: 20 1 21 2018-05-21 Zalan Bujtas <zalan@apple.com> 2 22 -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r232037 r232043 279 279 * Version 5. added support for Map and Set types. 280 280 * Version 6. added support for 8-bit strings. 281 * Version 7. added support for File's lastModified attribute. 281 282 */ 282 static const unsigned CurrentVersion = 6;283 static const unsigned CurrentVersion = 7; 283 284 static const unsigned TerminatorTag = 0xFFFFFFFF; 284 285 static const unsigned StringPoolTag = 0xFFFFFFFE; … … 364 365 * 365 366 * FileData :- 366 * <path:StringData> <url:StringData> <type:StringData> <name:StringData> 367 * <path:StringData> <url:StringData> <type:StringData> <name:StringData> <lastModified:double> 367 368 * 368 369 * FileList :- … … 1237 1238 write(file.type()); 1238 1239 write(file.name()); 1240 write(static_cast<double>(file.lastModifiedOverride().value_or(-1))); 1239 1241 } 1240 1242 … … 2037 2039 if (!readStringData(name)) 2038 2040 return false; 2041 std::optional<int64_t> optionalLastModified; 2042 if (m_version > 6) { 2043 double lastModified; 2044 if (!read(lastModified)) 2045 return false; 2046 if (lastModified >= 0) 2047 optionalLastModified = lastModified; 2048 } 2039 2049 2040 2050 // If the blob URL for this file has an associated blob file path, prefer that one over the "built-in" path. … … 2044 2054 2045 2055 if (m_isDOMGlobalObject) 2046 file = File::deserialize(filePath, URL(URL(), url->string()), type->string(), name->string() );2056 file = File::deserialize(filePath, URL(URL(), url->string()), type->string(), name->string(), optionalLastModified); 2047 2057 return true; 2048 2058 } -
trunk/Source/WebCore/fileapi/File.cpp
r232037 r232043 64 64 } 65 65 66 File::File(DeserializationContructor, const String& path, const URL& url, const String& type, const String& name )66 File::File(DeserializationContructor, const String& path, const URL& url, const String& type, const String& name, const std::optional<int64_t>& lastModified) 67 67 : Blob(deserializationContructor, url, type, -1, path) 68 68 , m_path(path) 69 69 , m_name(name) 70 , m_lastModifiedDateOverride(lastModified) 70 71 { 71 72 } … … 81 82 : Blob(WTFMove(blobPartVariants), convertPropertyBag(propertyBag)) 82 83 , m_name(filename) 83 , m_ overrideLastModifiedDate(propertyBag.lastModified.value_or(WallTime::now().secondsSinceEpoch().milliseconds()))84 , m_lastModifiedDateOverride(propertyBag.lastModified.value_or(WallTime::now().secondsSinceEpoch().milliseconds())) 84 85 { 85 86 } … … 97 98 , m_relativePath(file.relativePath()) 98 99 , m_name(!name.isNull() ? name : file.name()) 99 , m_ overrideLastModifiedDate(file.m_overrideLastModifiedDate)100 , m_lastModifiedDateOverride(file.m_lastModifiedDateOverride) 100 101 , m_isDirectory(file.isDirectory()) 101 102 { 102 103 } 103 104 104 doubleFile::lastModified() const105 int64_t File::lastModified() const 105 106 { 106 if (m_ overrideLastModifiedDate)107 return m_ overrideLastModifiedDate.value();107 if (m_lastModifiedDateOverride) 108 return m_lastModifiedDateOverride.value(); 108 109 109 doubleresult;110 int64_t result; 110 111 111 112 // FIXME: This does sync-i/o on the main thread and also recalculates every time the method is called. -
trunk/Source/WebCore/fileapi/File.h
r232037 r232043 39 39 public: 40 40 struct PropertyBag : BlobPropertyBag { 41 std::optional< long long> lastModified;41 std::optional<int64_t> lastModified; 42 42 }; 43 43 … … 53 53 } 54 54 55 static Ref<File> deserialize(const String& path, const URL& srcURL, const String& type, const String& name )55 static Ref<File> deserialize(const String& path, const URL& srcURL, const String& type, const String& name, const std::optional<int64_t>& lastModified = std::nullopt) 56 56 { 57 return adoptRef(*new File(deserializationContructor, path, srcURL, type, name ));57 return adoptRef(*new File(deserializationContructor, path, srcURL, type, name, lastModified)); 58 58 } 59 59 … … 84 84 void setRelativePath(const String& relativePath) { m_relativePath = relativePath; } 85 85 const String& name() const { return m_name; } 86 WEBCORE_EXPORT double lastModified() const; 86 WEBCORE_EXPORT int64_t lastModified() const; // Number of milliseconds since Epoch. 87 const std::optional<int64_t>& lastModifiedOverride() const { return m_lastModifiedDateOverride; } // Number of milliseconds since Epoch. 87 88 88 89 static String contentTypeForFile(const String& path); … … 101 102 File(const File&, const String& name); 102 103 103 File(DeserializationContructor, const String& path, const URL& srcURL, const String& type, const String& name );104 File(DeserializationContructor, const String& path, const URL& srcURL, const String& type, const String& name, const std::optional<int64_t>& lastModified); 104 105 105 106 static void computeNameAndContentType(const String& path, const String& nameOverride, String& effectiveName, String& effectiveContentType); … … 112 113 String m_name; 113 114 114 std::optional<int64_t> m_ overrideLastModifiedDate;115 std::optional<int64_t> m_lastModifiedDateOverride; 115 116 mutable std::optional<bool> m_isDirectory; 116 117 };
Note: See TracChangeset
for help on using the changeset viewer.