| 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 library jsTest; | 5 library jsTest; |
| 6 | 6 |
| 7 import 'dart:js'; | 7 import 'dart:js'; |
| 8 | 8 |
| 9 // TODO(jmesserly): get tests from package(s) instead. | 9 // TODO(jmesserly): get tests from package(s) instead. |
| 10 import 'dom.dart'; | 10 import 'dom.dart'; |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 var result = context.callMethod('testJsMap', | 440 var result = context.callMethod('testJsMap', |
| 441 [() => new JsObject.jsify({'value': 42})]); | 441 [() => new JsObject.jsify({'value': 42})]); |
| 442 expect(result, 42); | 442 expect(result, 42); |
| 443 }); | 443 }); |
| 444 | 444 |
| 445 test('emulated functions should be callable in JS', () { | 445 test('emulated functions should be callable in JS', () { |
| 446 context['callable'] = new Callable(); | 446 context['callable'] = new Callable(); |
| 447 var result = context.callMethod('callable'); | 447 var result = context.callMethod('callable'); |
| 448 expect(result, 'called'); | 448 expect(result, 'called'); |
| 449 context.deleteProperty('callable'); | 449 context.deleteProperty('callable'); |
| 450 }, skip: "https://github.com/dart-lang/dev_compiler/issues/244"); | 450 }); |
| 451 | 451 |
| 452 }); | 452 }); |
| 453 | 453 |
| 454 group('JsObject.jsify()', () { | 454 group('JsObject.jsify()', () { |
| 455 | 455 |
| 456 test('convert a List', () { | 456 test('convert a List', () { |
| 457 final list = [1, 2, 3, 4, 5, 6, 7, 8]; | 457 final list = [1, 2, 3, 4, 5, 6, 7, 8]; |
| 458 var array = new JsObject.jsify(list); | 458 var array = new JsObject.jsify(list); |
| 459 expect(context.callMethod('isArray', [array]), true); | 459 expect(context.callMethod('isArray', [array]), true); |
| 460 expect(array['length'], list.length); | 460 expect(array['length'], list.length); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 context['o'] = ctx.createImageData(1, 1); | 696 context['o'] = ctx.createImageData(1, 1); |
| 697 var imageDataType = context['ImageData']; | 697 var imageDataType = context['ImageData']; |
| 698 expect(context.callMethod('isPropertyInstanceOf', ['o', imageDataType]), | 698 expect(context.callMethod('isPropertyInstanceOf', ['o', imageDataType]), |
| 699 true); | 699 true); |
| 700 context.deleteProperty('o'); | 700 context.deleteProperty('o'); |
| 701 }); | 701 }); |
| 702 | 702 |
| 703 }); | 703 }); |
| 704 }); | 704 }); |
| 705 } | 705 } |
| OLD | NEW |