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

Side by Side Diff: tests/lib_strong/html/typing_test.dart

Issue 2456803004: fixes #27586, prefer context type in generic inference (Closed)
Patch Set: fix Created 3 years, 9 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 | « tests/lib_strong/html/js_typed_interop_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import 'dart:html'; 1 import 'dart:html';
2 2
3 import 'package:expect/minitest.dart'; 3 import 'package:expect/minitest.dart';
4 4
5 main() { 5 main() {
6 var isStyleSheetList = 6 var isStyleSheetList =
7 predicate((x) => x is List<StyleSheet>, 'is a List<StyleSheet>'); 7 predicate((x) => x is List<StyleSheet>, 'is a List<StyleSheet>');
8 8
9 test('NodeList', () { 9 test('NodeList', () {
10 List<Node> asList = window.document.queryAll('body'); 10 List<Element> asList = window.document.queryAll('body');
11 // Check it's Iterable 11 // Check it's Iterable
12 int counter = 0; 12 int counter = 0;
13 for (Node node in window.document.queryAll('body')) { 13 for (Element node in window.document.queryAll('body')) {
14 counter++; 14 counter++;
15 } 15 }
16 expect(counter, 1); 16 expect(counter, 1);
17 counter = 0; 17 counter = 0;
18 window.document.queryAll('body').forEach((e) { counter++; }); 18 window.document.queryAll('body').forEach((e) { counter++; });
19 expect(counter, 1); 19 expect(counter, 1);
20 }); 20 });
21 21
22 test('StyleSheetList', () { 22 test('StyleSheetList', () {
23 var document = window.document as HtmlDocument; 23 var document = window.document as HtmlDocument;
24 List<StyleSheet> asList = document.styleSheets; 24 List<StyleSheet> asList = document.styleSheets;
25 expect(asList, isStyleSheetList); 25 expect(asList, isStyleSheetList);
26 // Check it's Iterable. 26 // Check it's Iterable.
27 int counter = 0; 27 int counter = 0;
28 for (StyleSheet styleSheet in document.styleSheets) { 28 for (StyleSheet styleSheet in document.styleSheets) {
29 counter++; 29 counter++;
30 } 30 }
31 31
32 // There are no style sheets. 32 // There are no style sheets.
33 expect(counter, 0); 33 expect(counter, 0);
34 }); 34 });
35 } 35 }
OLDNEW
« no previous file with comments | « tests/lib_strong/html/js_typed_interop_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698