Chromium Code Reviews| Index: tests/html/js_typed_interop_test.dart |
| diff --git a/tests/html/js_typed_interop_test.dart b/tests/html/js_typed_interop_test.dart |
| index 0e7cd0c301e0095936adeb5787c03fb7657478f9..14d931f0d69ec46d16ee00151d29406804ad76fe 100644 |
| --- a/tests/html/js_typed_interop_test.dart |
| +++ b/tests/html/js_typed_interop_test.dart |
| @@ -86,6 +86,11 @@ _injectJs() { |
| return this.str.charCodeAt(index); |
| } |
| }; |
| + function getCanvasContext() { |
| + return document.createElement('canvas').getContext('2d'); |
| + } |
| + window.windowProperty = 42; |
| + document.documentProperty = 45; |
| """); |
| } |
| @@ -176,6 +181,15 @@ class StringWrapper { |
| @JS() |
| external confuse(obj); |
| +@JS() |
| +external CanvasRenderingContext2D getCanvasContext(); |
| + |
| +@JS('window.window.document.documentProperty') |
| +external num get propertyOnDocument; |
| + |
| +@JS('window.self.window.window.windowProperty') |
| +external num get propertyOnWindow; |
| + |
| main() { |
| _injectJs(); |
| @@ -374,4 +388,13 @@ main() { |
| expect(selection is List, isTrue); |
| }); |
| }); |
| + group('html', () { |
| + test('return html type', () { |
| + expect(getCanvasContext() is CanvasRenderingContext2D, isTrue); |
| + }); |
| + test('js path contains html types', () { |
|
Alan Knight
2015/11/04 18:44:14
nit: Not clear to me what this testing.
Jacob
2015/11/04 19:01:30
This case would fail previously
note the path to
|
| + expect(propertyOnWindow, equals(42)); |
| + expect(propertyOnDocument, equals(45)); |
| + }); |
| + }); |
| } |