Index: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/appcache-ordering-main.https.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/appcache-ordering-main.html b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/appcache-ordering-main.https.html |
similarity index 86% |
copy from third_party/WebKit/LayoutTests/http/tests/serviceworker/appcache-ordering-main.html |
copy to third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/appcache-ordering-main.https.html |
index 5a39c264a00d4c65ef91f22416e844314e1ed909..609d67e4504c9488780369c15e1b96fc0bd20394 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/appcache-ordering-main.html |
+++ b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/appcache-ordering-main.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> |
<body> |
<script> |
@@ -13,6 +13,8 @@ var SERVICE_WORKER_SCRIPT = "resources/empty-worker.js"; |
var resolve_install_appcache = undefined; |
var reject_install_appcache = undefined; |
+var frames = []; |
+ |
// Called by the INSTALL_APPCACHE_URL child frame. |
function notify_appcache_installed(success) { |
if (success) |
@@ -24,8 +26,9 @@ function notify_appcache_installed(success) { |
function install_appcache() { |
return new Promise(function(resolve, reject) { |
var frame = document.createElement('iframe'); |
+ frames.push(frame); |
frame.src = INSTALL_APPCACHE_URL; |
- document.body.appendChild(frame); |
+ document.body.appendChild(frame); |
resolve_install_appcache = function() { |
document.body.removeChild(frame); |
resolve(); |
@@ -47,6 +50,7 @@ function notify_is_appcached(is) { |
function is_appcached() { |
return new Promise(function(resolve) { |
var frame = document.createElement('iframe'); |
+ frames.push(frame); |
frame.src = IS_APPCACHED_URL; |
document.body.appendChild(frame); |
resolve_is_appcached = function(is) { |
@@ -69,14 +73,15 @@ async_test(function(t) { |
return service_worker_unregister_and_register( |
t, SERVICE_WORKER_SCRIPT, SERVICE_WORKER_SCOPE); |
}) |
- .then(function(r) { |
+ .then(function(r) { |
return wait_for_state(t, r.installing, 'activated'); |
}) |
- .then(function() { |
+ .then(function() { |
return is_appcached(); |
}) |
.then(function(result) { |
assert_false(result, 'but serviceworkers should take priority'); |
+ frames.forEach(function(f) { f.remove(); }); |
service_worker_unregister_and_done(t, SERVICE_WORKER_SCOPE); |
}) |
.catch(unreached_rejection(t)); |