diff options
author | WPT Sync Bot <josh+wptsync@joshmatthews.net> | 2018-04-26 21:09:36 -0400 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2018-04-27 17:36:30 +0200 |
commit | 84b40513c3c87d00cfac71bc9a25645ab2ad889c (patch) | |
tree | 0f7c030e4eaf76bd9ec9887bd4f7b78427c48434 /tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js | |
parent | 73b5bf201f47d831e90546bdec4f5664bad44e0c (diff) | |
download | servo-84b40513c3c87d00cfac71bc9a25645ab2ad889c.tar.gz servo-84b40513c3c87d00cfac71bc9a25645ab2ad889c.zip |
Update web-platform-tests to revision 4f397167b4ed552a02201c92d363cfaecfe2c7f0
Diffstat (limited to 'tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js')
-rw-r--r-- | tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js deleted file mode 100644 index 9bf73a69365..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js +++ /dev/null @@ -1,48 +0,0 @@ -if (this.document === undefined) { - importScripts("/resources/testharness.js"); - importScripts("../resources/utils.js"); -} - -function checkFetchResponse(url, data, mime, size, desc) { - promise_test(function(test) { - size = size.toString(); - return fetch(url).then(function(resp) { - assert_equals(resp.status, 200, "HTTP status is 200"); - assert_equals(resp.type, "basic", "response type is basic"); - assert_equals(resp.headers.get("Content-Type"), mime, "Content-Type is " + resp.headers.get("Content-Type")); - assert_equals(resp.headers.get("Content-Length"), size, "Content-Length is " + resp.headers.get("Content-Length")); - return resp.text(); - }).then(function(bodyAsText) { - assert_equals(bodyAsText, data, "Response's body is " + data); - }); - }, desc); -} - -var blob = new Blob(["Blob's data"], { "type" : "text/plain" }); -checkFetchResponse(URL.createObjectURL(blob), "Blob's data", "text/plain", blob.size, - "Fetching [GET] URL.createObjectURL(blob) is OK"); - -function checkKoUrl(url, method, desc) { - promise_test(function(test) { - var promise = fetch(url, {"method": method}); - return promise_rejects(test, new TypeError(), promise); - }, desc); -} - -var blob2 = new Blob(["Blob's data"], { "type" : "text/plain" }); -checkKoUrl("blob:http://{{domains[www]}}:{{ports[http][0]}}/", "GET", - "Fetching [GET] blob:http://{{domains[www]}}:{{ports[http][0]}}/ is KO"); - -var invalidRequestMethods = [ - "POST", - "OPTIONS", - "HEAD", - "PUT", - "DELETE", - "INVALID", -]; -invalidRequestMethods.forEach(function(method) { - checkKoUrl(URL.createObjectURL(blob2), method, "Fetching [" + method + "] URL.createObjectURL(blob) is KO"); -}); - -done(); |