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

Unified Diff: LayoutTests/vibration/vibration-detached-no-crash.html

Issue 298683002: navigator.vibrate() crash avoidance when in a detached state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rephrase null check Created 6 years, 7 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/vibration/vibration-detached-no-crash.html
diff --git a/LayoutTests/vibration/vibration-detached-no-crash.html b/LayoutTests/vibration/vibration-detached-no-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..46b12de5a54a8e51b7acdd480115bf094bb626f8
--- /dev/null
+++ b/LayoutTests/vibration/vibration-detached-no-crash.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<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.");
+
+window.jsTestIsAsync = true;
+
+var w;
+function processMessage(event) {
+ if (event.data == "opened") {
+ w.close();
+ } else if (event.data == "closed") {
+ shouldBeFalse("w.navigator.vibrate([])");
+ finishJSTest();
+ }
+}
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.setCanOpenWindows();
+}
+w = window.open('resources/vibration-detached-no-crash-new-window.html');
+window.addEventListener("message", processMessage, false);
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698