aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-04-29 17:18:36 -0500
committerbors-servo <metajack+bors@gmail.com>2015-04-29 17:18:36 -0500
commit037729fc4d54a6c171d19f7e72d6c85fa29b49e3 (patch)
tree97aa23ffdc295d8eb6a50e3702429213b4e25294
parent19a4a263645a643d3a3f79b41b816fe8b8727265 (diff)
parent14e48d959c5e28d3d5f837f376f96c3b1ab7b117 (diff)
downloadservo-037729fc4d54a6c171d19f7e72d6c85fa29b49e3.tar.gz
servo-037729fc4d54a6c171d19f7e72d6c85fa29b49e3.zip
Auto merge of #5897 - Ms2ger:wpt_20150429, r=jdm
<!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5897) <!-- Reviewable:end -->
-rw-r--r--tests/wpt/metadata/MANIFEST.json2
-rw-r--r--tests/wpt/metadata/encoding/api-invalid-label.html.ini218
-rw-r--r--tests/wpt/metadata/mozilla-sync2
-rw-r--r--tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex6-event_order.htm3
-rw-r--r--tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex7-event_order.htm3
-rw-r--r--tests/wpt/web-platform-tests/encoding/api-invalid-label.html31
-rw-r--r--tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js32
-rw-r--r--tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-delete.js28
-rw-r--r--tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js35
-rw-r--r--tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js34
-rw-r--r--tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage-match.js7
-rw-r--r--tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage.js26
-rw-r--r--tests/wpt/web-platform-tests/service-workers/cache-storage/window/sandboxed-iframes.https.html2
-rw-r--r--tests/wpt/web-platform-tests/webstorage/idlharness.html6
-rw-r--r--tests/wpt/web-platform-tests/workers/support/WorkerTerminate.js4
15 files changed, 302 insertions, 131 deletions
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json
index 6425a7fd530..90d23f18817 100644
--- a/tests/wpt/metadata/MANIFEST.json
+++ b/tests/wpt/metadata/MANIFEST.json
@@ -25295,7 +25295,7 @@
}
]
},
- "rev": "acdb8bf3e4714528b6b5f9ff038dc80ee4fb7dcf",
+ "rev": "fef3eb9bbb033d1d7150f4c70ecc1a5f59bcf115",
"url_base": "/",
"version": 2
} \ No newline at end of file
diff --git a/tests/wpt/metadata/encoding/api-invalid-label.html.ini b/tests/wpt/metadata/encoding/api-invalid-label.html.ini
new file mode 100644
index 00000000000..3f31413c569
--- /dev/null
+++ b/tests/wpt/metadata/encoding/api-invalid-label.html.ini
@@ -0,0 +1,218 @@
+[api-invalid-label.html]
+ type: testharness
+ [Invalid label "\\vunicode-1-1-utf-8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "unicode-1-1-utf-8\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vunicode-1-1-utf-8\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " unicode-1-1-utf-8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "unicode-1-1-utf-8 " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " unicode-1-1-utf-8 " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
unicode-1-1-utf-8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "unicode-1-1-utf-8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
unicode-1-1-utf-8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
unicode-1-1-utf-8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "unicode-1-1-utf-8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
unicode-1-1-utf-8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf-8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-8\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf-8\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf-8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-8 " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf-8 " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf8\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf8\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf8 " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf8 " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf8" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf8
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf-16be" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16be\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf-16be\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf-16be" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16be " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf-16be " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16be" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16be
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16be
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16be" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16be
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16be
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf-16" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf-16\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf-16" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16 " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf-16 " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf-16le" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16le\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "\\vutf-16le\\v" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf-16le" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16le " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label " utf-16le " should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16le" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16le
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16le
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16le" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "utf-16le
" should be rejected by TextEncoder.]
+ expected: FAIL
+
+ [Invalid label "
utf-16le
" should be rejected by TextEncoder.]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/mozilla-sync b/tests/wpt/metadata/mozilla-sync
index 91e695ee7c0..0488b7f9d24 100644
--- a/tests/wpt/metadata/mozilla-sync
+++ b/tests/wpt/metadata/mozilla-sync
@@ -1 +1 @@
-56a7981c9c9c6df30fbb3add3d8d0085916fe313 \ No newline at end of file
+7ee605db117bfc96ef145a1c77d43b704baeacb2 \ No newline at end of file
diff --git a/tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex6-event_order.htm b/tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex6-event_order.htm
index 20b4890382d..10c04b6a8a7 100644
--- a/tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex6-event_order.htm
+++ b/tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex6-event_order.htm
@@ -11,6 +11,9 @@
<script src=support.js></script>
<script>
+ // Transaction may fire window.onerror in some implementations.
+ setup({allow_uncaught_exception:true});
+
var db,
events = [],
t = async_test(document.title, {timeout: 10000})
diff --git a/tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex7-event_order.htm b/tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex7-event_order.htm
index 23e3dbb8752..89e8cb36ce6 100644
--- a/tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex7-event_order.htm
+++ b/tests/wpt/web-platform-tests/IndexedDB/idbobjectstore_createIndex7-event_order.htm
@@ -13,6 +13,9 @@
<script src="support.js"></script>
<script>
+ // Transaction may fire window.onerror in some implementations.
+ setup({allow_uncaught_exception:true});
+
var db,
events = [],
t = async_test(document.title, {timeout: 10000})
diff --git a/tests/wpt/web-platform-tests/encoding/api-invalid-label.html b/tests/wpt/web-platform-tests/encoding/api-invalid-label.html
index 04f939a789d..2f2fd6eb0c6 100644
--- a/tests/wpt/web-platform-tests/encoding/api-invalid-label.html
+++ b/tests/wpt/web-platform-tests/encoding/api-invalid-label.html
@@ -2,13 +2,32 @@
<title>Encoding API: invalid label</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
+<script src="resources/encodings.js"></script>
<script>
+var tests = ["invalid-invalidLabel"];
+setup(function() {
+ encodings_table.forEach(function(section) {
+ section.encodings.filter(function(encoding) {
+ return encoding.name !== 'replacement';
+ }).forEach(function(encoding) {
+ encoding.labels.forEach(function(label) {
+ ["\u0000", "\u000b", "\u00a0", "\u2028", "\u2029"].forEach(function(ws) {
+ tests.push(ws + label);
+ tests.push(label + ws);
+ tests.push(ws + label + ws);
+ });
+ });
+ });
+ });
+});
-var invalidLabel = "invalid-invalidLabel"
-
-test(function() {
- assert_throws(new RangeError(), function() { new TextEncoder(invalidLabel); });
- assert_throws(new RangeError(), function() { new TextDecoder(invalidLabel); });
-}, 'Invalid label "' + invalidLabel + '" should be rejected by API.');
+tests.forEach(function(input) {
+ test(function() {
+ assert_throws(new RangeError(), function() { new TextEncoder(input); });
+ }, 'Invalid label ' + format_value(input) + ' should be rejected by TextEncoder.');
+ test(function() {
+ assert_throws(new RangeError(), function() { new TextDecoder(input); });
+ }, 'Invalid label ' + format_value(input) + ' should be rejected by TextDecoder.');
+});
</script>
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js
index 3e827382bd1..49b8db4cd71 100644
--- a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js
+++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js
@@ -22,12 +22,12 @@ cache_test(function(cache) {
cache_test(function(cache) {
return assert_promise_rejects(
cache.add('javascript://this-is-not-http-mmkay'),
- 'NetworkError',
- 'Cache.add should throw a NetworkError for non-HTTP/HTTPS URLs.');
+ new TypeError(),
+ 'Cache.add should throw a TypeError for non-HTTP/HTTPS URLs.');
}, 'Cache.add called with non-HTTP/HTTPS URL');
cache_test(function(cache) {
- var request = new Request('../resources/simple.txt', {method: 'POST', body: 'Hello'});
+ var request = new Request('../resources/simple.txt');
return cache.add(request)
.then(function(result) {
assert_equals(result, undefined,
@@ -36,28 +36,18 @@ cache_test(function(cache) {
}, 'Cache.add called with Request object');
cache_test(function(cache) {
- var request = new Request('../resources/simple.txt', {method: 'POST', body: 'Hello'});
- return request.text()
- .then(function() {
- assert_false(request.bodyUsed);
- })
- .then(function() {
- return cache.add(request);
- });
- }, 'Cache.add called with Request object with a used body');
-
-cache_test(function(cache) {
- var request = new Request('../resources/simple.txt', {method: 'POST', body: 'Hello'});
+ var request = new Request('../resources/simple.txt');
return cache.add(request)
.then(function(result) {
assert_equals(result, undefined,
'Cache.add should resolve with undefined on success.');
})
.then(function() {
- return assert_promise_rejects(
- cache.add(request),
- new TypeError(),
- 'Cache.add should throw TypeError if same request is added twice.');
+ return cache.add(request);
+ })
+ .then(function(result) {
+ assert_equals(result, undefined,
+ 'Cache.add should resolve with undefined on success.');
});
}, 'Cache.add called twice with the same Request object');
@@ -137,8 +127,8 @@ cache_test(function(cache) {
var request = new Request('../resources/simple.txt');
return assert_promise_rejects(
cache.addAll([request, request]),
- new TypeError(),
- 'Cache.addAll should throw TypeError if the same request is added ' +
+ 'InvalidStateError',
+ 'Cache.addAll should throw InvalidStateError if the same request is added ' +
'twice.');
}, 'Cache.addAll called with the same Request object specified twice');
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-delete.js b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-delete.js
index 36ca8473164..75a474c2b2c 100644
--- a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-delete.js
+++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-delete.js
@@ -43,8 +43,8 @@ cache_test(function(cache) {
}, 'Cache.delete called with a string URL');
cache_test(function(cache) {
- var request = new Request(test_url, { method: 'POST', body: 'Abc' });
- return cache.put(request.clone(), new_test_response())
+ var request = new Request(test_url);
+ return cache.put(request, new_test_response())
.then(function() {
return cache.delete(request);
})
@@ -52,34 +52,10 @@ cache_test(function(cache) {
assert_true(result,
'Cache.delete should resolve with "true" if an entry ' +
'was successfully deleted.');
- assert_false(request.bodyUsed,
- 'Cache.delete should not consume request body.');
});
}, 'Cache.delete called with a Request object');
cache_test(function(cache) {
- var request = new Request(test_url, { method: 'POST', body: 'Abc' });
- return cache.put(request.clone(), new_test_response())
- .then(function() {
- return request.text();
- })
- .then(function() {
- assert_true(request.bodyUsed,
- '[https://fetch.spec.whatwg.org/#body-mixin] ' +
- 'Request.bodyUsed should be true after text() method ' +
- 'resolves.');
- })
- .then(function() {
- return cache.delete(request);
- })
- .then(function(result) {
- assert_true(result,
- 'Cache.delete should resolve with "true" if an entry ' +
- 'was successfully deleted.');
- });
- }, 'Cache.delete with a Request object containing used body');
-
-cache_test(function(cache) {
return cache.delete(test_url)
.then(function(result) {
assert_false(result,
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js
index 4a027b6f165..3b3b9b6b5cf 100644
--- a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js
+++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js
@@ -181,32 +181,6 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
});
}, 'Cache.match with new Request');
-cache_test(function(cache) {
- var request = new Request('https://example.com/foo', {
- method: 'POST',
- body: 'Hello world!'
- });
- var response = new Response('Booyah!', {
- status: 200,
- headers: {'Content-Type': 'text/plain'}
- });
-
- return cache.put(request.clone(), response.clone())
- .then(function() {
- assert_false(
- request.bodyUsed,
- '[https://fetch.spec.whatwg.org/#concept-body-used-flag] ' +
- 'Request.bodyUsed flag should be initially false.');
- })
- .then(function() {
- return cache.match(request);
- })
- .then(function(result) {
- assert_false(request.bodyUsed,
- 'Cache.match should not consume Request body.');
- });
- }, 'Cache.match with Request containing non-empty body');
-
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll(entries.a.request,
{ignoreSearch: true})
@@ -464,6 +438,15 @@ cache_test(function(cache) {
});
}, 'Cache.match invoked multiple times for the same Request/Response');
+prepopulated_cache_test(simple_entries, function(cache, entries) {
+ var request = new Request(entries.a.request, { method: 'POST' });
+ return cache.match(request)
+ .then(function(result) {
+ assert_equals(result, undefined,
+ 'Cache.match should not find a match');
+ });
+ }, 'Cache.match with POST Request');
+
// Helpers ---
// Run |test_function| with a Cache object as its only parameter. Prior to the
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js
index ec1617f04e9..54a0d558494 100644
--- a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js
+++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js
@@ -68,29 +68,6 @@ cache_test(function(cache) {
}, 'Cache.put with Response without a body');
cache_test(function(cache) {
- var request = new Request(test_url, {
- method: 'POST',
- body: 'Hello'
- });
- var response = new Response(test_body);
- assert_false(request.bodyUsed,
- '[https://fetch.spec.whatwg.org/#dom-body-bodyused] ' +
- 'Request.bodyUsed should be initially false.');
- return cache.put(request, response.clone())
- .then(function() {
- assert_true(request.bodyUsed,
- 'Cache.put should consume Request body.');
- })
- .then(function() {
- return cache.match(request);
- })
- .then(function(result) {
- assert_object_equals(result, response,
- 'Cache.put should store response body.');
- });
- }, 'Cache.put with Request containing a body');
-
-cache_test(function(cache) {
var request = new Request(test_url);
var response = new Response(test_body);
return cache.put(request, response.clone())
@@ -294,18 +271,11 @@ cache_test(function(cache) {
cache_test(function(cache) {
var request = new Request(test_url, {method: 'POST', body: test_body});
- assert_false(request.bodyUsed,
- '[https://fetch.spec.whatwg.org/#dom-body-bodyused] ' +
- 'Request.bodyUsed should be initially false.');
- var copy = new Request(request);
- assert_true(request.bodyUsed,
- '[https://fetch.spec.whatwg.org/#dom-request] ' +
- 'Request constructor should set input\'s used flag.');
return assert_promise_rejects(
cache.put(request, new Response(test_body)),
new TypeError(),
- 'Cache.put should throw a TypeError for a request with used body.');
- }, 'Cache.put with a used request body');
+ 'Cache.put should throw a TypeError for a POST request.');
+ }, 'Cache.put with a POST request');
cache_test(function(cache) {
var response = new Response(test_body);
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage-match.js b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage-match.js
index 06b2888e891..0de85146a6a 100644
--- a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage-match.js
+++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage-match.js
@@ -111,8 +111,11 @@ promise_test(function(test) {
return self.caches.match(transaction.request, {cacheName: 'foo'});
})
.then(function(response) {
- assert_equals(response, undefined,
- 'The response should not be found.');
+ assert_unreached('The match with bad cache name should reject.');
+ })
+ .catch(function(err) {
+ assert_equals(err.name, 'NotFoundError',
+ 'The match should reject with NotFoundError.');
return self.caches.has('foo');
})
.then(function(has_foo) {
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage.js b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage.js
index cb8e0483b22..a8d4e7e61de 100644
--- a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage.js
+++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage.js
@@ -106,6 +106,7 @@ promise_test(function(t) {
promise_test(function(t) {
var cache_name = 'cache-storage/open';
+ var url = '../resources/simple.txt';
var cache;
return self.caches.delete(cache_name)
.then(function() {
@@ -115,21 +116,26 @@ promise_test(function(t) {
cache = result;
})
.then(function() {
- return self.caches.open(cache_name);
- })
- .then(function(result) {
- assert_equals(result, cache,
- 'CacheStorage.open should return the named Cache ' +
- 'object if it exists.');
+ return cache.add('../resources/simple.txt');
})
.then(function() {
return self.caches.open(cache_name);
})
.then(function(result) {
- assert_equals(result, cache,
- 'CacheStorage.open should return the same ' +
- 'instance of an existing Cache object.');
- });
+ assert_true(result instanceof Cache,
+ 'CacheStorage.open should return a Cache object');
+ assert_not_equals(result, cache,
+ 'CacheStorage.open should return a new Cache ' +
+ 'object each time its called.');
+ return Promise.all([cache.keys(), result.keys()]);
+ })
+ .then(function(results) {
+ var expected_urls = results[0].map(function(r) { return r.url });
+ var actual_urls = results[1].map(function(r) { return r.url });
+ assert_array_equals(actual_urls, expected_urls,
+ 'CacheStorage.open should return a new Cache ' +
+ 'object for the same backing store.');
+ })
}, 'CacheStorage.open with existing cache');
promise_test(function(t) {
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/window/sandboxed-iframes.https.html b/tests/wpt/web-platform-tests/service-workers/cache-storage/window/sandboxed-iframes.https.html
index aa8613ec77d..de70db4e137 100644
--- a/tests/wpt/web-platform-tests/service-workers/cache-storage/window/sandboxed-iframes.https.html
+++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/window/sandboxed-iframes.https.html
@@ -23,7 +23,7 @@ function wait_for_message(id) {
self.addEventListener('message', function listener(e) {
if (e.data.id === id) {
resolve(e.data);
- self.removeEventListener(listener);
+ self.removeEventListener('message', listener);
}
});
});
diff --git a/tests/wpt/web-platform-tests/webstorage/idlharness.html b/tests/wpt/web-platform-tests/webstorage/idlharness.html
index 9c82721366d..094e12616ee 100644
--- a/tests/wpt/web-platform-tests/webstorage/idlharness.html
+++ b/tests/wpt/web-platform-tests/webstorage/idlharness.html
@@ -30,7 +30,7 @@ interface EventInit {
interface Storage {
readonly attribute unsigned long length;
DOMString? key(unsigned long index);
- getter DOMString getItem(DOMString key);
+ getter DOMString? getItem(DOMString key);
setter creator void setItem(DOMString key, DOMString value);
deleter void removeItem(DOMString key);
void clear();
@@ -47,7 +47,7 @@ interface WindowLocalStorage {
Window implements WindowLocalStorage;
[Constructor(DOMString type, optional StorageEventInit eventInitDict)]
interface StorageEvent : Event {
- readonly attribute DOMString key;
+ readonly attribute DOMString? key;
readonly attribute DOMString? oldValue;
readonly attribute DOMString? newValue;
readonly attribute DOMString url;
@@ -55,7 +55,7 @@ interface StorageEvent : Event {
};
dictionary StorageEventInit : EventInit {
- DOMString key;
+ DOMString? key;
DOMString? oldValue;
DOMString? newValue;
DOMString url;
diff --git a/tests/wpt/web-platform-tests/workers/support/WorkerTerminate.js b/tests/wpt/web-platform-tests/workers/support/WorkerTerminate.js
index 03e028746da..7c99e7ec560 100644
--- a/tests/wpt/web-platform-tests/workers/support/WorkerTerminate.js
+++ b/tests/wpt/web-platform-tests/workers/support/WorkerTerminate.js
@@ -2,9 +2,9 @@ onmessage = function(evt)
{
for (var i=0; true; i++)
{
- if (i%1000 == 1)
+ if (i%1000 == 0)
{
postMessage(i);
}
}
-} \ No newline at end of file
+}