run-operation.tentative.https.sub.html (1120B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/shared-storage/resources/util.js"></script> 5 6 <body> 7 <script> 8 'use strict'; 9 10 promise_test(async t => { 11 await addModuleOnce("/shared-storage/resources/simple-module.js"); 12 return sharedStorage.run("operation1", {keepAlive: true}); 13 }, 'run()'); 14 15 promise_test(async t => { 16 await addModuleOnce("/shared-storage/resources/simple-module.js"); 17 return sharedStorage.run("operation1", 18 {data: {'custom-key': 'custom-value'}, 19 keepAlive: true}); 20 }, 'run() with custom data'); 21 22 promise_test(async t => { 23 try { 24 await addModuleOnce("/shared-storage/resources/simple-module.js"); 25 await sharedStorage.run("operation1", {data: window}); 26 } catch (e) { 27 assert_equals(e.name, 'DataCloneError'); 28 assert_equals(e.message, 'Failed to execute \'run\' on \'SharedStorage\': #<Window> could not be cloned.'); 29 return; 30 } 31 assert_unreached("did not reject"); 32 }, 'run() with unsupported serializable type'); 33 34 </script> 35 </body>