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

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

Issue 1336933003: [Migrated][Fetch] Support blob: scheme (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Network Error for non-GET blob URLs. 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-blob.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/thorough/scheme-blob.js b/LayoutTests/http/tests/fetch/script-tests/thorough/scheme-blob.js
new file mode 100644
index 0000000000000000000000000000000000000000..a7965145752772088271150e411a2968c13d084c
--- /dev/null
+++ b/LayoutTests/http/tests/fetch/script-tests/thorough/scheme-blob.js
@@ -0,0 +1,32 @@
+if (self.importScripts) {
+ importScripts('/fetch/resources/fetch-test-helpers.js');
+ importScripts('/fetch/resources/thorough-util.js');
+}
+
+var url = URL.createObjectURL(new Blob(["report({jsonpResult: 'success'});"], {type: 'application/json'}));
+
+var TEST_TARGETS = [
+// Same-origin blob: requests.
+ [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=GET',
+ [fetchResolved, hasContentLength, noServerHeader, hasBody, typeBasic],
+ [checkJsonpSuccess]],
+ [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=cors&method=GET',
+ [fetchResolved, hasContentLength, noServerHeader, hasBody, typeBasic],
+ [checkJsonpSuccess]],
+ [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=no-cors&method=GET',
+ [fetchResolved, hasContentLength, noServerHeader, hasBody, typeBasic],
+ [checkJsonpSuccess]],
+
+// blob: requests with non-GET methods.
+ [BASE_URL + 'url=' + encodeURIComponent(url) +
+ '&mode=same-origin&method=POST',
+ [fetchRejected]],
+ [BASE_URL + 'url=' + encodeURIComponent(url) +
+ '&mode=same-origin&method=HEAD',
+ [fetchRejected]],
+];
+
+if (self.importScripts) {
+ executeTests(TEST_TARGETS);
+ done();
+}

Powered by Google App Engine
This is Rietveld 408576698