Files
sdk/tests/html/typing_test.dart
T
Terry Lucas bc75856e54 Update getClientRects, removed xtab, removed bogus entry in dom.json,
expose ServiceWorker, removed query and queryAll from in dart:html,
added constructor to MessageChannel and removed getCssCanvasContext.

Fixed all tests using query and queryAll.

Fixes https://github.com/dart-lang/sdk/issues/25664
Fixes https://github.com/dart-lang/sdk/issues/26349
Fixes https://github.com/dart-lang/sdk/issues/32323
Fixes https://github.com/dart-lang/sdk/issues/32659
Fixes https://github.com/dart-lang/sdk/issues/32675

R=kevmoo@google.com

Change-Id: I687471e80b8fe9c7040673113f424dbaab7c64d4
Reviewed-on: https://dart-review.googlesource.com/48381
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2018-03-27 20:45:33 +00:00

41 lines
1002 B
Dart

library TypingTest;
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
import 'dart:html';
main() {
useHtmlConfiguration();
var isStyleSheetList =
predicate((x) => x is List<StyleSheet>, 'is a List<StyleSheet>');
test('NodeList', () {
List<Node> asList = window.document.querySelectorAll('body');
// Check it's Iterable
int counter = 0;
for (Node node in window.document.querySelectorAll('body')) {
counter++;
}
expect(counter, 1);
counter = 0;
window.document.querySelectorAll('body').forEach((e) {
counter++;
});
expect(counter, 1);
});
test('StyleSheetList', () {
List<StyleSheet> asList = window.document.styleSheets;
expect(asList, isStyleSheetList);
// Check it's Iterable.
int counter = 0;
for (StyleSheet styleSheet in window.document.styleSheets) {
counter++;
}
// There is one style sheet from the unittest framework.
expect(counter, 1);
});
}