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

Unified 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, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-fetch-serviceworker.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-fetch-serviceworker.html b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-fetch-serviceworker.html
new file mode 100644
index 0000000000000000000000000000000000000000..8f7472f63101b5552d2215299bb790196ac440c4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-fetch-serviceworker.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Credential Manager: PasswordCredential fetch with serviceworker.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="/serviceworker/resources/test-helpers.js"></script>
+<script>
+function assert_resolves(promise) {
+ return promise.catch(function(reason) {
+ throw new Error(reason);
+ });
+}
+
+function assert_rejects(promise, description) {
+ return promise.then(
+ function(reason) { throw new Error(reason); },
+ function() {});
+}
+
+promise_test(t => {
+ var scope = "./resources/fetch-serviceworker.html";
+ return service_worker_unregister_and_register(t, './resources/respond-with-body.js', scope)
+ .then(reg => wait_for_state(t, reg.installing, 'activated'))
+ .then(_ => with_iframe(scope))
+ .then(iframe => assert_resolves(iframe.contentWindow.testServiceWorkerVisibility()))
+ .then(_ => service_worker_unregister_and_done(t, scope));
horo 2016/04/04 05:32:17 Nit: Remove trailing whitespace.
+}, "Credential not visible to service worker's body.");
+
+promise_test(t => {
+ var scope = "./resources/fetch-serviceworker.html";
+ return with_iframe(scope)
horo 2016/04/04 05:32:17 You have to register the Service Worker before cal
+ .then(iframe => assert_resolves(iframe.contentWindow.testServiceWorkerNetworkVisibility()))
+ .then(_ => service_worker_unregister_and_done(t, scope));
horo 2016/04/04 05:32:17 Nit: Remove trailing whitespace.
+}, "Credential visible to network endpoint through service worker.");
+</script>

Powered by Google App Engine
This is Rietveld 408576698