aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-04-01 18:03:57 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-04-01 18:03:57 +0530
commit7ea01868fcb81d5b42a33eb6989ef8c044114430 (patch)
treea14b4f23f6a0bba47b23e725269be2e6125145a7 /tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js
parent95819a4334526751168de0b9868dbd76e27b0d57 (diff)
parent78369e95cf7ed0813cb9342747caa4984ae7c527 (diff)
downloadservo-7ea01868fcb81d5b42a33eb6989ef8c044114430.tar.gz
servo-7ea01868fcb81d5b42a33eb6989ef8c044114430.zip
Auto merge of #10315 - jgraham:update-wpt, r=Ms2ger
Update web-platform-tests to 5582e4d2bfcfd1fa9f105406b143170ee2af7db1 <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10315) <!-- Reviewable:end -->
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.js17
1 files changed, 7 insertions, 10 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
index d9b804d4e58..d7e5ece7a4b 100644
--- a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js
+++ b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js
@@ -4,9 +4,6 @@ if (this.document === undefined) {
}
function checkFetchResponse(url, data, mime, size, desc) {
- if (!desc)
- var cut = (url.length >= 45) ? "[...]" : "";
- desc = "Fetching " + url.substring(0, 45) + cut + " is OK"
promise_test(function(test) {
size = size.toString();
return fetch(url).then(function(resp) {
@@ -17,17 +14,15 @@ function checkFetchResponse(url, data, mime, size, desc) {
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);
+checkFetchResponse(URL.createObjectURL(blob), "Blob's data", "text/plain", blob.size,
+ "Fetching [GET] URL.createObjectURL(blob) is OK");
function checkKoUrl(url, method, desc) {
- if (!desc)
- var cut = (url.length >= 45) ? "[...]" : "";
- desc = "Fetching [" + method + "] " + url.substring(0, 45) + cut + " is KO"
promise_test(function(test) {
var promise = fetch(url, {"method": method});
return promise_rejects(test, new TypeError(), promise);
@@ -35,7 +30,9 @@ function checkKoUrl(url, method, desc) {
}
var blob2 = new Blob(["Blob's data"], { "type" : "text/plain" });
-checkKoUrl("blob:http://{{domains[www]}}:{{ports[http][0]}}/", "GET");
-checkKoUrl(URL.createObjectURL(blob2), "POST");
+checkKoUrl("blob:http://{{domains[www]}}:{{ports[http][0]}}/", "GET",
+ "Fetching [GET] blob:http://{{domains[www]}}:{{ports[http][0]}}/ is KO");
+checkKoUrl(URL.createObjectURL(blob2), "POST",
+ "Fetching [POST] URL.createObjectURL(blob) is KO");
done();