| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_native_test; | 6 library js_native_test; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 import 'dart:typed_data' show ByteBuffer, Int32List; | 10 import 'dart:typed_data' show ByteBuffer, Int32List; |
| 11 import 'dart:indexed_db' show IdbFactory, KeyRange; | 11 import 'dart:indexed_db' show IdbFactory, KeyRange; |
| 12 | 12 |
| 13 import 'package:js/js.dart'; | 13 import 'package:js/js.dart'; |
| 14 import 'package:js/js_util.dart' as js_util; | 14 import 'package:js/js_util.dart' as js_util; |
| 15 import 'package:minitest/minitest.dart'; | 15 import 'package:expect/minitest.dart'; |
| 16 | 16 |
| 17 _injectJs() { | 17 _injectJs() { |
| 18 final script = new ScriptElement(); | 18 final script = new ScriptElement(); |
| 19 script.type = 'text/javascript'; | 19 script.type = 'text/javascript'; |
| 20 script.innerHtml = r""" | 20 script.innerHtml = r""" |
| 21 var x = 42; | 21 var x = 42; |
| 22 | 22 |
| 23 var _x = 123; | 23 var _x = 123; |
| 24 | 24 |
| 25 var myArray = ["value1"]; | 25 var myArray = ["value1"]; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 expect(textNode is Text, isTrue); | 334 expect(textNode is Text, isTrue); |
| 335 expect(textNode.text, equals('foo')); | 335 expect(textNode.text, equals('foo')); |
| 336 }); | 336 }); |
| 337 | 337 |
| 338 test('typed object', () { | 338 test('typed object', () { |
| 339 Foo f = js_util.callConstructor(JSFooType, [42]); | 339 Foo f = js_util.callConstructor(JSFooType, [42]); |
| 340 expect(f.a, equals(42)); | 340 expect(f.a, equals(42)); |
| 341 }); | 341 }); |
| 342 }); | 342 }); |
| 343 } | 343 } |
| OLD | NEW |