Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: LayoutTests/battery-status/detached-no-crash.html

Issue 915033002: BatteryManager.getBattery(): gracefully bail on context-detached use. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tidying up test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698