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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library ClientRectTest;
2 import 'package:unittest/unittest.dart'; 1 import 'package:unittest/unittest.dart';
3 import 'package:unittest/html_config.dart'; 2 import 'package:unittest/html_config.dart';
4 import 'dart:html'; 3 import 'dart:html';
5 4
6 main() { 5 main() {
7 6 var isGamepadList =
8 var isRectList = 7 predicate((x) => x is List<Gamepad>, 'is a List<Gamepad>');
9 predicate((x) => x is List<Rectangle>, 'is a List<Rectangle>');
10 8
11 insertTestDiv() { 9 insertTestDiv() {
12 var element = new Element.tag('div'); 10 var element = new Element.tag('div');
13 element.innerHtml = r''' 11 element.innerHtml = r'''
14 A large block of text should go here. Click this 12 A large block of text should go here. Click this
15 block of text multiple times to see each line 13 block of text multiple times to see each line
16 highlight with every click of the mouse button. 14 highlight with every click of the mouse button.
17 '''; 15 ''';
18 document.body.append(element); 16 document.body.append(element);
19 return element; 17 return element;
20 } 18 }
21 19
22 useHtmlConfiguration(); 20 useHtmlConfiguration();
23 21
24 test("ClientRectList test", () { 22 test("getGamepads", () {
25 insertTestDiv(); 23 insertTestDiv();
26 var range = new Range(); 24 var gamepads = window.navigator.getGamepads();
27 var rects = range.getClientRects(); 25 expect(gamepads, isGamepadList);
28 expect(rects, isRectList); 26 for (var gamepad in gamepads) {
27 if (gamepad != null) {
28 expect(gamepad.id, isNotNull);
29 }
30 }
29 }); 31 });
30 } 32 }
OLDNEW
« 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