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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/skip-waiting-installed.https.html

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Rebase Created 4 years, 2 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: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/skip-waiting-installed.https.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/skip-waiting-installed.html b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/skip-waiting-installed.https.html
similarity index 73%
copy from third_party/WebKit/LayoutTests/http/tests/serviceworker/skip-waiting-installed.html
copy to third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/skip-waiting-installed.https.html
index e7b1a192434489df6694f1355a0b70092e41f547..42e4000b1f678bd6c431451c3e7d96c96981b905 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/skip-waiting-installed.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/skip-waiting-installed.https.html
@@ -1,21 +1,25 @@
<!DOCTYPE html>
<title>Service Worker: Skip waiting installed worker</title>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="resources/test-helpers.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="resources/testharness-helpers.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
<script>
promise_test(function(t) {
var scope = 'resources/blank.html';
var url1 = 'resources/empty.js';
var url2 = 'resources/skip-waiting-installed-worker.js';
- var frame, frame_sw, service_worker, onmessage, oncontrollerchanged;
+ var frame, frame_sw, service_worker, registration, onmessage, oncontrollerchanged;
var saw_message = new Promise(function(resolve) {
onmessage = function(e) {
var message = e.data;
assert_equals(
message, 'PASS',
- 'skipWaiting promise should be resolved after activated');
+ 'skipWaiting promise should be resolved with undefined');
+
+ assert_equals(registration.active.scriptURL, normalizeURL(url2),
+ "skipWaiting should make worker become active");
resolve();
};
});
@@ -28,8 +32,8 @@ promise_test(function(t) {
};
});
return service_worker_unregister_and_register(t, url1, scope)
- .then(function(registration) {
- return wait_for_state(t, registration.installing, 'activated');
+ .then(function(r) {
+ return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
return with_iframe(scope);
@@ -43,8 +47,9 @@ promise_test(function(t) {
frame_sw.oncontrollerchange = t.step_func(oncontrollerchanged);
return navigator.serviceWorker.register(url2, {scope: scope});
})
- .then(function(registration) {
- service_worker = registration.installing;
+ .then(function(r) {
+ registration = r;
+ service_worker = r.installing;
return wait_for_state(t, service_worker, 'installed');
})
.then(function() {

Powered by Google App Engine
This is Rietveld 408576698