4 <script src=
"../resources/js-test.js"></script>
7 description("Accessing navigator.getBattery() on a closed window.");
9 window
.jsTestIsAsync
= true;
14 function processMessage(event
) {
15 if (event
.data
== "opened") {
17 shouldBeTrue("typeof(nav.getBattery()) == 'object'");
20 } else if (event
.data
== "closed") {
21 shouldBeUndefined("nav.getBattery()");
26 if (window
.testRunner
) {
27 testRunner
.dumpAsText();
28 testRunner
.setCanOpenWindows();
30 w
= window
.open('../resources/window-postmessage-open-close.html');
31 window
.addEventListener("message", processMessage
, false);