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

Unified Diff: LayoutTests/http/tests/fetch/script-tests/fetch-access-control-auth-nocors.js

Issue 921673003: [Fetch] Split layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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: LayoutTests/http/tests/fetch/script-tests/fetch-access-control-auth-nocors.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/fetch-access-control-auth-nocors.js b/LayoutTests/http/tests/fetch/script-tests/fetch-access-control-auth-nocors.js
new file mode 100644
index 0000000000000000000000000000000000000000..5a7e1de78373f350453f4a8715e9fcfd68326da4
--- /dev/null
+++ b/LayoutTests/http/tests/fetch/script-tests/fetch-access-control-auth-nocors.js
@@ -0,0 +1,63 @@
+if (self.importScripts) {
+ importScripts('../resources/fetch-test-helpers.js');
+ importScripts('/serviceworker/resources/fetch-access-control-util.js');
+}
+
+var TEST_TARGETS = [
+ // Auth check
+ // Test that default mode is no-cors in serviceworker-proxied tests.
+ onlyOnServiceWorkerProxiedTest(
+ [BASE_URL + 'Auth',
+ [fetchResolved, hasBody], [authCheck1]]),
+ onlyOnServiceWorkerProxiedTest(
+ [BASE_URL + 'Auth&credentials=omit',
+ [fetchResolved, hasBody], [checkJsonpError]]),
+ onlyOnServiceWorkerProxiedTest(
+ [BASE_URL + 'Auth&credentials=include',
+ [fetchResolved, hasBody], [authCheck1]]),
+ onlyOnServiceWorkerProxiedTest(
+ [BASE_URL + 'Auth&credentials=same-origin',
+ [fetchResolved, hasBody], [authCheck1]]),
+
+ // Tests for same-origin requests.
+ [BASE_URL + 'Auth&mode=no-cors&credentials=omit',
+ [fetchResolved, hasBody], [checkJsonpError]],
+ [BASE_URL + 'Auth&mode=no-cors&credentials=include',
+ [fetchResolved, hasBody], [authCheck1]],
+ [BASE_URL + 'Auth&mode=no-cors&credentials=same-origin',
+ [fetchResolved, hasBody], [authCheck1]],
+
+ // Test that default mode is no-cors in serviceworker-proxied tests.
+ onlyOnServiceWorkerProxiedTest(
+ [OTHER_BASE_URL + 'Auth',
+ [fetchResolved, noBody, typeOpaque],
+ [authCheck2]]),
+ onlyOnServiceWorkerProxiedTest(
+ [OTHER_BASE_URL + 'Auth&credentials=omit',
+ [fetchResolved, noBody, typeOpaque],
+ [checkJsonpError]]),
+ onlyOnServiceWorkerProxiedTest(
+ [OTHER_BASE_URL + 'Auth&credentials=include',
+ [fetchResolved, noBody, typeOpaque],
+ [authCheck2]]),
+ onlyOnServiceWorkerProxiedTest(
+ [OTHER_BASE_URL + 'Auth&credentials=same-origin',
+ [fetchResolved, noBody, typeOpaque],
+ [authCheck2]]),
+
+ // Tests for cross-origin requests.
+ [OTHER_BASE_URL + 'Auth&mode=no-cors&credentials=omit',
+ [fetchResolved, noBody, typeOpaque],
+ onlyOnServiceWorkerProxiedTest([checkJsonpError])],
+ [OTHER_BASE_URL + 'Auth&mode=no-cors&credentials=include',
+ [fetchResolved, noBody, typeOpaque],
+ onlyOnServiceWorkerProxiedTest([authCheck2])],
+ [OTHER_BASE_URL + 'Auth&mode=no-cors&credentials=same-origin',
+ [fetchResolved, noBody, typeOpaque],
+ onlyOnServiceWorkerProxiedTest([authCheck2])],
+];
+
+if (self.importScripts) {
+ executeTests(TEST_TARGETS);
+ done();
+}

Powered by Google App Engine
This is Rietveld 408576698