| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 @JS() | 5 @JS() |
| 6 library js_typed_interop_test; | 6 library js_typed_interop_test; |
| 7 | 7 |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 | 9 |
| 10 import 'package:js/js.dart'; | 10 import 'package:js/js.dart'; |
| 11 import 'package:minitest/minitest.dart'; | 11 import 'package:expect/minitest.dart'; |
| 12 | 12 |
| 13 _injectJs() { | 13 _injectJs() { |
| 14 document.body.append(new ScriptElement() | 14 document.body.append(new ScriptElement() |
| 15 ..type = 'text/javascript' | 15 ..type = 'text/javascript' |
| 16 ..innerHtml = r""" | 16 ..innerHtml = r""" |
| 17 var Foo = { | 17 var Foo = { |
| 18 multiplyDefault2: function(a, b) { | 18 multiplyDefault2: function(a, b) { |
| 19 if (arguments.length >= 2) return a *b; | 19 if (arguments.length >= 2) return a *b; |
| 20 return a * 2; | 20 return a * 2; |
| 21 } | 21 } |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 group('html', () { | 415 group('html', () { |
| 416 test('return html type', () { | 416 test('return html type', () { |
| 417 expect(getCanvasContext() is CanvasRenderingContext2D, isTrue); | 417 expect(getCanvasContext() is CanvasRenderingContext2D, isTrue); |
| 418 }); | 418 }); |
| 419 test('js path contains html types', () { | 419 test('js path contains html types', () { |
| 420 expect(propertyOnWindow, equals(42)); | 420 expect(propertyOnWindow, equals(42)); |
| 421 expect(propertyOnDocument, equals(45)); | 421 expect(propertyOnDocument, equals(45)); |
| 422 }); | 422 }); |
| 423 }); | 423 }); |
| 424 } | 424 } |
| OLD | NEW |