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

Unified Diff: LayoutTests/http/tests/fetch/script-tests/thorough/scheme-data.js

Issue 1283163003: [Fetch][WIP] Support blob:, about:, and data: URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup. Created 5 years, 3 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/thorough/scheme-data.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/thorough/scheme-data.js b/LayoutTests/http/tests/fetch/script-tests/thorough/scheme-data.js
new file mode 100644
index 0000000000000000000000000000000000000000..bcd31e06f97fbdae98dbb254753b5c2286db4b64
--- /dev/null
+++ b/LayoutTests/http/tests/fetch/script-tests/thorough/scheme-data.js
@@ -0,0 +1,46 @@
+if (self.importScripts) {
+ importScripts('/fetch/resources/fetch-test-helpers.js');
+ importScripts('/fetch/resources/thorough-util.js');
+}
+
+var url = "data:application/json,report({jsonpResult: 'success'});";
+
+var TEST_TARGETS = [
+// data: requests.
+ [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=GET',
+ [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typeBasic],
+ [checkJsonpSuccess]],
+ [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=cors&method=GET',
+ [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typeBasic],
+ [checkJsonpSuccess]],
+ [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=no-cors&method=GET',
+ [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typeBasic],
+ [checkJsonpSuccess]],
+
+// data: requests with non-GET methods.
+ [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=POST',
+ [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typeBasic],
+ [checkJsonpSuccess]],
+ [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=HEAD',
+ [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typeBasic],
+ [checkJsonpSuccess]],
+
+// data: requests with same-origin redirects.
+ [REDIRECT_URL + encodeURIComponent(url) + '&mode=same-origin&method=GET',
+ [fetchRejected]],
+ [REDIRECT_URL + encodeURIComponent(url) + '&mode=cors&method=GET',
+ [fetchRejected]],
+
+// data: requests with cross-origin redirects.
+ [OTHER_REDIRECT_URL + encodeURIComponent(url) +
+ '&mode=same-origin&method=GET&ACAOrigin=*',
+ [fetchRejected]],
+ [OTHER_REDIRECT_URL + encodeURIComponent(url) +
+ '&mode=cors&method=GET&ACAOrigin=*',
+ [fetchRejected]],
+];
+
+if (self.importScripts) {
+ executeTests(TEST_TARGETS);
+ done();
+}

Powered by Google App Engine
This is Rietveld 408576698