Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-fetch-serviceworker.html

Issue 1847383003: CREDENTIAL: Rework the integration with Fetch (2/2) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-serialized
Patch Set: unittest Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698