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