Index: LayoutTests/gamepad/gamepad-polling-access.html |
diff --git a/LayoutTests/gamepad/gamepad-polling-access.html b/LayoutTests/gamepad/gamepad-polling-access.html |
index 9bc59a50000bf0ea0e608d7e1eaaa4d61e4238d7..a156b9a545d1c888c93a5d28c6422cfa7ccf4782 100644 |
--- a/LayoutTests/gamepad/gamepad-polling-access.html |
+++ b/LayoutTests/gamepad/gamepad-polling-access.html |
@@ -9,22 +9,38 @@ |
gamepadController.disconnect(1); |
gamepadController.disconnect(2); |
gamepadController.disconnect(3); |
- shouldBe("navigator.getGamepads().length", "4"); |
- shouldBeNull("navigator.getGamepads().item(0)"); |
- shouldBeNull("navigator.getGamepads().item(1)"); |
- shouldBeNull("navigator.getGamepads().item(2)"); |
- shouldBeNull("navigator.getGamepads().item(3)"); |
- shouldBeUndefined("navigator.getGamepads()[0]"); |
- shouldBeUndefined("navigator.getGamepads()[1]"); |
- shouldBeUndefined("navigator.getGamepads()[2]"); |
- shouldBeUndefined("navigator.getGamepads()[3]"); |
+ |
+ shouldBeType("navigator.getGamepads()", "Array"); |
+ shouldBe("navigator.getGamepads().length", "0"); |
+ shouldBeFalse("navigator.getGamepads().hasOwnProperty(0)"); |
+ shouldBeFalse("navigator.getGamepads().hasOwnProperty(1)"); |
// connect and disconnect |
gamepadController.connect(0); |
- shouldBeNonNull("navigator.getGamepads()[0]"); |
+ shouldBe("navigator.getGamepads().length", "1"); |
+ shouldBeTrue("navigator.getGamepads().hasOwnProperty(0)"); |
+ shouldBeType("navigator.getGamepads()[0]", "Gamepad"); |
+ shouldBe("navigator.getGamepads()[0].index", "0"); |
+ shouldBeFalse("navigator.getGamepads().hasOwnProperty(1)"); |
+ gamepadController.connect(1); |
+ shouldBe("navigator.getGamepads().length", "2"); |
+ shouldBeTrue("navigator.getGamepads().hasOwnProperty(0)"); |
+ shouldBeType("navigator.getGamepads()[0]", "Gamepad"); |
+ shouldBe("navigator.getGamepads()[0].index", "0"); |
+ shouldBeTrue("navigator.getGamepads().hasOwnProperty(1)"); |
+ shouldBeType("navigator.getGamepads()[1]", "Gamepad"); |
+ shouldBe("navigator.getGamepads()[1].index", "1"); |
gamepadController.disconnect(0); |
- shouldBeNull("navigator.getGamepads().item(0)"); |
- shouldBeUndefined("navigator.getGamepads()[0]"); |
+ shouldBe("navigator.getGamepads().length", "2"); |
+ shouldBeTrue("navigator.getGamepads().hasOwnProperty(0)"); // FIXME |
+ shouldBeNull("navigator.getGamepads()[0]"); // FIXME |
+ shouldBeTrue("navigator.getGamepads().hasOwnProperty(1)"); |
+ shouldBeType("navigator.getGamepads()[1]", "Gamepad"); |
+ shouldBe("navigator.getGamepads()[1].index", "1"); |
+ gamepadController.disconnect(1); |
+ shouldBe("navigator.getGamepads().length", "0"); |
+ shouldBeFalse("navigator.getGamepads().hasOwnProperty(0)"); |
+ shouldBeFalse("navigator.getGamepads().hasOwnProperty(1)"); |
// connect again, and check standard access |
gamepadController.connect(0); |