4 <title>navigator.serviceWorker should return null when frame is detached
</title>
5 <script src=
"../../resources/testharness.js"></script>
6 <script src=
"../../resources/testharnessreport.js"></script>
9 <iframe id=
"subframe" src=
"about:blank"></iframe>
11 promise_test(function(t
) {
12 var iframe
= document
.querySelector("#subframe");
13 var f
= iframe
.contentWindow
.Function
;
14 function get_navigator() {
15 return f("return navigator")();
17 return new Promise(function(resolve
) {
18 assert_equals(iframe
.contentWindow
.navigator
, get_navigator());
19 iframe
.src
= "resources/a.html";
20 iframe
.onload
= resolve
;
22 assert_equals(get_navigator().serviceWorker
, null);