Index: tests/html/gamepad_test.dart |
diff --git a/tests/html/client_rect_test.dart b/tests/html/gamepad_test.dart |
similarity index 60% |
copy from tests/html/client_rect_test.dart |
copy to tests/html/gamepad_test.dart |
index b9c9bb547582979bf494e4b6ada696c8c64be29d..6bbef593d8df0537318ebcdb2d33d5c58ac55c9a 100644 |
--- a/tests/html/client_rect_test.dart |
+++ b/tests/html/gamepad_test.dart |
@@ -1,12 +1,10 @@ |
-library ClientRectTest; |
import 'package:unittest/unittest.dart'; |
import 'package:unittest/html_config.dart'; |
import 'dart:html'; |
main() { |
- |
- var isRectList = |
- predicate((x) => x is List<Rectangle>, 'is a List<Rectangle>'); |
+ var isGamepadList = |
+ predicate((x) => x is List<Gamepad>, 'is a List<Gamepad>'); |
insertTestDiv() { |
var element = new Element.tag('div'); |
@@ -21,10 +19,14 @@ main() { |
useHtmlConfiguration(); |
- test("ClientRectList test", () { |
+ test("getGamepads", () { |
insertTestDiv(); |
- var range = new Range(); |
- var rects = range.getClientRects(); |
- expect(rects, isRectList); |
+ var gamepads = window.navigator.getGamepads(); |
+ expect(gamepads, isGamepadList); |
+ for (var gamepad in gamepads) { |
+ if (gamepad != null) { |
+ expect(gamepad.id, isNotNull); |
+ } |
+ } |
}); |
} |