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

Unified Diff: tests/html/gamepad_test.dart

Issue 2242203002: record that Gamepad.buttons creates GamepadButtons (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add test Created 4 years, 4 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/scripts/dartmetadata.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
+ }
});
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/scripts/dartmetadata.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698