Index: LayoutTests/battery-status/detached-no-crash.html |
diff --git a/LayoutTests/vibration/vibration-detached-no-crash.html b/LayoutTests/battery-status/detached-no-crash.html |
similarity index 60% |
copy from LayoutTests/vibration/vibration-detached-no-crash.html |
copy to LayoutTests/battery-status/detached-no-crash.html |
index 46b12de5a54a8e51b7acdd480115bf094bb626f8..3caf6e0543c46182c722c6e673fdf3b1c34aa7ae 100644 |
--- a/LayoutTests/vibration/vibration-detached-no-crash.html |
+++ b/LayoutTests/battery-status/detached-no-crash.html |
@@ -2,19 +2,23 @@ |
<body> |
<head> |
<script src="../resources/js-test.js"></script> |
-<script src="vibration-utils.js"></script> |
</head> |
<script> |
-description("Accessing navigator.vibrate on a closed window."); |
+description("Accessing navigator.getBattery() on a closed window."); |
window.jsTestIsAsync = true; |
var w; |
+var nav; |
+ |
function processMessage(event) { |
if (event.data == "opened") { |
+ nav = w.navigator; |
+ shouldBeTrue("typeof(nav.getBattery()) == 'object'"); |
w.close(); |
+ w = null; |
} else if (event.data == "closed") { |
- shouldBeFalse("w.navigator.vibrate([])"); |
+ shouldBeUndefined("nav.getBattery()"); |
finishJSTest(); |
} |
} |
@@ -23,7 +27,7 @@ if (window.testRunner) { |
testRunner.dumpAsText(); |
testRunner.setCanOpenWindows(); |
} |
-w = window.open('resources/vibration-detached-no-crash-new-window.html'); |
+w = window.open('../resources/window-postmessage-open-close.html'); |
window.addEventListener("message", processMessage, false); |
</script> |
</body> |