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

Side by Side Diff: third_party/WebKit/LayoutTests/gamepad/gamepad-api.html

Issue 2341723002: binding: Indexed property returns undefined if out-of-range. (Closed)
Patch Set: Updated layout test expectations. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <script src="../resources/js-test.js"></script> 3 <script src="../resources/js-test.js"></script>
4 <script> 4 <script>
5 description("Validates the exposed Gamepad API.") 5 description("Validates the exposed Gamepad API.")
6 6
7 shouldBeDefined("navigator.getGamepads"); 7 shouldBeDefined("navigator.getGamepads");
8 shouldBeDefined("GamepadEvent"); 8 shouldBeDefined("GamepadEvent");
9 9
10 gamepads = navigator.getGamepads(); 10 gamepads = navigator.getGamepads();
11 shouldBe("gamepads.length", "4"); 11 shouldBe("gamepads.length", "4");
12 shouldBeUndefined("gamepads[0]"); 12 shouldBeNull("gamepads[0]");
13 shouldBe("gamepads.item.__proto__", "Function.prototype") 13 shouldBe("gamepads.item.__proto__", "Function.prototype")
14 shouldBeNull("gamepads.item(0)"); 14 shouldBeNull("gamepads.item(0)");
15 15
16 if (window.gamepadController) 16 if (window.gamepadController)
17 { 17 {
18 gamepadController.connect(0); 18 gamepadController.connect(0);
19 gamepadController.setId(0, "MockStick 3000"); 19 gamepadController.setId(0, "MockStick 3000");
20 gamepadController.setButtonCount(0, 1); 20 gamepadController.setButtonCount(0, 1);
21 gamepadController.setAxisCount(0, 1); 21 gamepadController.setAxisCount(0, 1);
22 22
(...skipping 11 matching lines...) Expand all
34 shouldBe("gamepad.buttons[0].pressed.__proto__", "Boolean.prototype"); 34 shouldBe("gamepad.buttons[0].pressed.__proto__", "Boolean.prototype");
35 shouldBe("gamepad.buttons[0].value.__proto__", "Number.prototype"); 35 shouldBe("gamepad.buttons[0].value.__proto__", "Number.prototype");
36 shouldBe("gamepad.mapping.__proto__", "String.prototype"); 36 shouldBe("gamepad.mapping.__proto__", "String.prototype");
37 } 37 }
38 else 38 else
39 { 39 {
40 testFailed("no gamepadController available."); 40 testFailed("no gamepadController available.");
41 } 41 }
42 </script> 42 </script>
43 </body> 43 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698