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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/register-same-scope-different-script-url.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/register-same-scope-different-script-url.https.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/register-same-scope-different-script-url.html b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/register-same-scope-different-script-url.https.html
similarity index 92%
copy from third_party/WebKit/LayoutTests/http/tests/serviceworker/register-same-scope-different-script-url.html
copy to third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/register-same-scope-different-script-url.https.html
index ff2b248fde12d85a453fce33f6a664de5c22ad39..445be740951b16aaec304e1679f58981f3e3d7ba 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/register-same-scope-different-script-url.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/register-same-scope-different-script-url.https.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<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>
<script>
var script1 = normalizeURL('resources/empty-worker.js');
var script2 = normalizeURL('resources/empty-worker.js?new');
@@ -84,10 +84,17 @@ async_test(function(t) {
.then(function() {
assert_equals(registration.installing, null,
'on installed, installing should be null');
- assert_equals(registration.waiting.scriptURL, script2,
- 'on installed, the second script should be waiting');
- assert_equals(registration.active.scriptURL, script1,
- 'on installed, the first script should be active');
+ // Since the registration is not controlling any document, the new
+ // worker can immediately transition to active.
+ if (registration.waiting) {
+ assert_equals(registration.waiting.scriptURL, script2,
+ 'on installed, the second script may still be waiting');
+ assert_equals(registration.active.scriptURL, script1,
+ 'on installed, the first script may be active');
+ } else {
+ assert_equals(registration.active.scriptURL, script2,
+ 'on installed, the second script may be active');
+ }
return registration.unregister();
})
.then(function() {

Powered by Google App Engine
This is Rietveld 408576698