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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/waiting.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/waiting.https.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/waiting.html b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/waiting.https.html
similarity index 60%
copy from third_party/WebKit/LayoutTests/http/tests/serviceworker/waiting.html
copy to third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/waiting.https.html
index 4ece274a3e5f2d9693a37a46a5b8097f20d1c6b5..eff9c80a4f659ed9bb4918d49537796050a6cc2f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/waiting.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/waiting.https.html
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<title>ServiceWorker: navigator.serviceWorker.waiting</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/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
<body>
<script>
// "waiting" is set
@@ -26,16 +26,19 @@ async_test(function(t) {
.then(function() {
var controller = frame.contentWindow.navigator.serviceWorker.controller;
assert_equals(controller, null);
- assert_equals(registration.active, null);
- assert_equals(registration.waiting.scriptURL, normalizeURL(url));
+ // Nothing in the spec prohibits a worker from going to active
+ // immediately.
+ // Step 26 of the [[Install]] algorithm
+ // "If registration's waiting worker waitingWorker is not null and
+ // waitingWorker's skip waiting flag is not set, invoke Activate
+ // algorithm, or its equivalent, with registration as its argument."
+ var w = registration.waiting || registration.active;
+ assert_equals(w.scriptURL, normalizeURL(url));
assert_equals(registration.installing, null);
-
- // FIXME: Add a test for a frame created after installation.
- // Should the existing frame ("frame") block activation?
})
.then(function() {
frame.remove();
return service_worker_unregister_and_done(t, scope);
});
-}, 'waiting is set');
+}, 'waiting or active is set');
</script>

Powered by Google App Engine
This is Rietveld 408576698