Files
sdk/tests/html/typing_test.dart
T
gram@google.com 981c4b11df Restructure pkg/unittest and pkg/webdriver to follow the pub conventions.
This means all imports of unittest in our test code had to change to include 'lib' in the path.
While doing that change I changed the library/imports to the new syntax in the affected files.
Review URL: https://codereview.chromium.org//11301046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14443 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 23:09:47 +00:00

38 lines
979 B
Dart

library TypingTest;
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/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.queryAll('body');
// Check it's Iterable
int counter = 0;
for (Node node in window.document.queryAll('body')) {
counter++;
}
expect(counter, 1);
counter = 0;
window.document.queryAll('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);
});
}