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

Unified Diff: LayoutTests/gamepad/multiple-event-listeners.html

Issue 336693004: Deduplicate DeviceEvent* classes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: oops - fix grammar in test expectation as well 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
« no previous file with comments | « no previous file | LayoutTests/gamepad/multiple-event-listeners-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/gamepad/multiple-event-listeners.html
diff --git a/LayoutTests/gamepad/multiple-event-listeners.html b/LayoutTests/gamepad/multiple-event-listeners.html
new file mode 100644
index 0000000000000000000000000000000000000000..a7f9b78f7199bfefab1138b77de405b364e63538
--- /dev/null
+++ b/LayoutTests/gamepad/multiple-event-listeners.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/js-test.js"></script>
+<script>
+description("Test that when there are multiple gamepad event listeners and one is getting removed the others still receive events.");
+window.jsTestIsAsync = true;
+
+if (!window.gamepadController) {
+ debug("This test cannot work without gamepadController.");
+}
+
+var listenerToRemove = window.addEventListener('gamepadconnected', function() {});
+window.addEventListener('gamepadconnected', function() {
+ testPassed("gamepadconnected event received");
+ finishJSTest();
+});
+window.removeEventListener('gamepadconnected', listenerToRemove);
+
+setTimeout(function() {
+ testFailed("gamepadconnected event should have been recieved.");
+ finishJSTest();
+}, 50);
+
+if (gamepadController) {
+ gamepadController.connect(0);
+ gamepadController.dispatchConnected(0);
+}
+
+</script>
+</html>
« no previous file with comments | « no previous file | LayoutTests/gamepad/multiple-event-listeners-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698