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

Unified Diff: LayoutTests/gamepad/page-visibility-detach-while-dispatching.html

Issue 306363002: Gamepad: honor page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: just a comment that it will be better with Oilpan Created 6 years, 6 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/gamepad/page-visibility-detach-while-dispatching.html
diff --git a/LayoutTests/gamepad/page-visibility-detach-while-dispatching.html b/LayoutTests/gamepad/page-visibility-detach-while-dispatching.html
new file mode 100644
index 0000000000000000000000000000000000000000..4fc0cf85d9a3203826c93f322bb6b437c19fb7c9
--- /dev/null
+++ b/LayoutTests/gamepad/page-visibility-detach-while-dispatching.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+<script src="../resources/js-test.js"></script>
+<script>
+description("Test that we don't crash while dispatching pending gamepad events if the event handler detaches us.");
+
+if (!window.testRunner || !window.gamepadController)
+ document.write('This test cannot run without testRunner or gamepadController');
+
+window.addEventListener('gamepadconnected', function (event) {
+ shouldBeEqualToNumber('event.gamepad.index', 0);
+ shouldBeEqualToNumber('eventCount', 1);
+ document.write('PASS');
+});
+
+function start() {
+ testRunner.setPageVisibility('hidden');
+ gamepadController.connect(0);
+ gamepadController.connect(1);
+ testRunner.setPageVisibility('visible');
+}
+
+</script>
+<body onload="start()">
+FAIL
+</body>
+</html>
« no previous file with comments | « LayoutTests/gamepad/page-visibility.html ('k') | LayoutTests/gamepad/page-visibility-detach-while-dispatching-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698