mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 22:11:19 +00:00
1d749a2fec
This also extends the html generator to be able to generate List implementations with nullable element types Fixes https://github.com/dart-lang/sdk/issues/27073 R=sra@google.com, terry@google.com Review URL: https://codereview.chromium.org/2242203002 .
33 lines
808 B
Dart
33 lines
808 B
Dart
import 'package:unittest/unittest.dart';
|
|
import 'package:unittest/html_config.dart';
|
|
import 'dart:html';
|
|
|
|
main() {
|
|
var isGamepadList =
|
|
predicate((x) => x is List<Gamepad>, 'is a List<Gamepad>');
|
|
|
|
insertTestDiv() {
|
|
var element = new Element.tag('div');
|
|
element.innerHtml = r'''
|
|
A large block of text should go here. Click this
|
|
block of text multiple times to see each line
|
|
highlight with every click of the mouse button.
|
|
''';
|
|
document.body.append(element);
|
|
return element;
|
|
}
|
|
|
|
useHtmlConfiguration();
|
|
|
|
test("getGamepads", () {
|
|
insertTestDiv();
|
|
var gamepads = window.navigator.getGamepads();
|
|
expect(gamepads, isGamepadList);
|
|
for (var gamepad in gamepads) {
|
|
if (gamepad != null) {
|
|
expect(gamepad.id, isNotNull);
|
|
}
|
|
}
|
|
});
|
|
}
|