Index: LayoutTests/http/tests/serviceworker/clients-matchall.html |
diff --git a/LayoutTests/http/tests/serviceworker/clients-matchall.html b/LayoutTests/http/tests/serviceworker/clients-matchall.html |
index bece61bc733439c17ecac1d5d11f467e9e6c901c..b76e6482902d04fa7ad00ca38fcd8a808783d556 100644 |
--- a/LayoutTests/http/tests/serviceworker/clients-matchall.html |
+++ b/LayoutTests/http/tests/serviceworker/clients-matchall.html |
@@ -6,6 +6,7 @@ |
<script> |
var scope = 'resources/blank.html?clients-matchAll'; |
var t = async_test('Test Clients.matchAll()'); |
+var frame1, frame2; |
t.step(function() { |
service_worker_unregister_and_register( |
t, 'resources/clients-matchall-worker.js', scope) |
@@ -13,14 +14,16 @@ t.step(function() { |
return wait_for_state(t, registration.installing, 'activated'); |
}) |
.then(function() { return with_iframe(scope + '#1'); }) |
- .then(function(frame1) { |
- frame1.focus(); |
+ .then(function(f) { |
+ frame1 = f; |
+ f.focus(); |
return with_iframe(scope + '#2'); |
}) |
- .then(function(frame2) { |
+ .then(function(f) { |
+ frame2 = f; |
var channel = new MessageChannel(); |
channel.port1.onmessage = t.step_func(onMessage); |
- frame2.contentWindow.navigator.serviceWorker.controller.postMessage( |
+ f.contentWindow.navigator.serviceWorker.controller.postMessage( |
{port:channel.port2}, [channel.port2]); |
}) |
.catch(unreached_rejection(t)); |
@@ -36,6 +39,8 @@ function onMessage(e) { |
assert_equals(e.data.length, 2); |
assert_array_equals(e.data[0], expected[0]); |
assert_array_equals(e.data[1], expected[1]); |
+ frame1.remove(); |
+ frame2.remove(); |
service_worker_unregister_and_done(t, scope); |
} |
</script> |