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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html

Issue 2904063003: Upstream service worker "update" tests to WPT (Closed)
Patch Set: Move Chromium-specific test Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium.update-served-from-cache.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html
index 213b72ac837309d43112d7965a17e2162e7ffb9b..6717d4d7ac289c8a18b1500e21795fd16c5321e7 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html
@@ -5,12 +5,14 @@
<script src="resources/testharness-helpers.js"></script>
<script src="resources/test-helpers.sub.js"></script>
<script>
+'use strict';
+
promise_test(function(t) {
var scope = 'resources/simple.txt';
var worker_url = 'resources/update-worker.py';
var expected_url = normalizeURL(worker_url);
var registration;
- var iframe;
+
return service_worker_unregister_and_register(t, worker_url, scope)
.then(function(r) {
registration = r;
@@ -41,13 +43,11 @@ promise_test(function(t) {
.then(function() {
assert_equals(registration.installing, null,
'installing should be null after installing.');
- if (registration.waiting) {
- assert_equals(registration.waiting.scriptURL, expected_url,
- 'waiting should be set after installing.');
- assert_equals(registration.active.scriptURL, expected_url,
- 'active should still exist after installing.');
- return wait_for_state(t, registration.waiting, 'activated');
- }
+ assert_equals(registration.waiting.scriptURL, expected_url,
+ 'waiting should be set after installing.');
+ assert_equals(registration.active.scriptURL, expected_url,
+ 'active should still exist after installing.');
+ return wait_for_state(t, registration.waiting, 'activated');
})
.then(function() {
assert_equals(registration.installing, null,
@@ -107,17 +107,15 @@ promise_test(function(t) {
return with_iframe(scope);
})
.then(function(frame) {
- iframe = frame;
+ t.add_cleanup(function() {
+ frame.remove();
+ });
return assert_promise_rejects(
Promise.all([registration.unregister(), registration.update()]),
new TypeError(),
'Calling update() while the uninstalling flag is set ' +
'should return a promise that rejects with a TypeError.');
- })
- .then(function() {
- iframe.remove();
- return t.done();
});
}, 'Update a registration.');
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium.update-served-from-cache.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698