Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>Credential Manager: PasswordCredential fetch with serviceworker.</title> | |
| 3 <script src="../resources/testharness.js"></script> | |
| 4 <script src="../resources/testharnessreport.js"></script> | |
| 5 <script src="/serviceworker/resources/test-helpers.js"></script> | |
| 6 <script> | |
| 7 function assert_resolves(promise) { | |
| 8 return promise.catch(function(reason) { | |
| 9 throw new Error(reason); | |
| 10 }); | |
| 11 } | |
| 12 | |
| 13 function assert_rejects(promise, description) { | |
| 14 return promise.then( | |
| 15 function(reason) { throw new Error(reason); }, | |
| 16 function() {}); | |
| 17 } | |
| 18 | |
| 19 promise_test(t => { | |
| 20 var scope = "./resources/fetch-serviceworker.html"; | |
| 21 return service_worker_unregister_and_register(t, './resources/respond-with-b ody.js', scope) | |
| 22 .then(reg => wait_for_state(t, reg.installing, 'activated')) | |
| 23 .then(_ => with_iframe(scope)) | |
| 24 .then(iframe => assert_resolves(iframe.contentWindow.testServiceWorkerVi sibility())) | |
| 25 .then(_ => service_worker_unregister_and_done(t, scope)); | |
|
horo
2016/04/04 05:32:17
Nit: Remove trailing whitespace.
| |
| 26 }, "Credential not visible to service worker's body."); | |
| 27 | |
| 28 promise_test(t => { | |
| 29 var scope = "./resources/fetch-serviceworker.html"; | |
| 30 return with_iframe(scope) | |
|
horo
2016/04/04 05:32:17
You have to register the Service Worker before cal
| |
| 31 .then(iframe => assert_resolves(iframe.contentWindow.testServiceWorkerNe tworkVisibility())) | |
| 32 .then(_ => service_worker_unregister_and_done(t, scope)); | |
|
horo
2016/04/04 05:32:17
Nit: Remove trailing whitespace.
| |
| 33 }, "Credential visible to network endpoint through service worker."); | |
| 34 </script> | |
| OLD | NEW |