OLD | NEW |
1 library wrapping_collection_test; | |
2 | |
3 import 'dart:html'; | 1 import 'dart:html'; |
4 import 'dart:html_common'; | 2 import 'dart:html_common'; |
5 import 'dart:js' as js; | 3 import 'dart:js' as js; |
6 import 'package:unittest/unittest.dart'; | 4 |
7 import 'package:unittest/html_config.dart'; | 5 import 'package:expect/minitest.dart'; |
8 | 6 |
9 /// Test that if we access objects through JS-interop we get the | 7 /// Test that if we access objects through JS-interop we get the |
10 /// appropriate objects, even if dart:html maps them. | 8 /// appropriate objects, even if dart:html maps them. |
11 main() { | 9 main() { |
12 test("Access through JS-interop", () { | 10 test("Access through JS-interop", () { |
13 var performance = js.context['performance']; | 11 var performance = js.context['performance']; |
14 var entries = performance.callMethod('getEntries', const []); | 12 var entries = performance.callMethod('getEntries', const []); |
15 entries.forEach((x) { | 13 entries.forEach((x) { |
16 expect(x is js.JsObject, isTrue); | 14 expect(x is js.JsObject, isTrue); |
17 }); | 15 }); |
18 }); | 16 }); |
19 | 17 |
20 test("Access through dart:html", () { | 18 test("Access through dart:html", () { |
21 var dartPerformance = js.JsNative.toTypedObject(js.context['performance']); | 19 var dartPerformance = js.JsNative.toTypedObject(js.context['performance']); |
22 var dartEntries = dartPerformance.getEntries(); | 20 var dartEntries = dartPerformance.getEntries(); |
23 dartEntries.forEach((x) { | 21 dartEntries.forEach((x) { |
24 expect(x is PerformanceEntry, isTrue); | 22 expect(x is PerformanceEntry, isTrue); |
25 }); | 23 }); |
26 }); | 24 }); |
27 } | 25 } |
OLD | NEW |