| 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:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:typed_data' show ByteBuffer, Int32List; | 9 import 'dart:typed_data' show ByteBuffer, Int32List; |
| 10 import 'dart:indexed_db' show IdbFactory, KeyRange; | 10 import 'dart:indexed_db' show IdbFactory, KeyRange; |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 | 845 |
| 846 test('DateTime', () { | 846 test('DateTime', () { |
| 847 var date = context.callMethod('getNewDate'); | 847 var date = context.callMethod('getNewDate'); |
| 848 expect(date is DateTime, isTrue); | 848 expect(date is DateTime, isTrue); |
| 849 }); | 849 }); |
| 850 | 850 |
| 851 test('window', () { | 851 test('window', () { |
| 852 expect(context['window'] is Window, isTrue); | 852 expect(context['window'] is Window, isTrue); |
| 853 }); | 853 }); |
| 854 | 854 |
| 855 // Bug: dartbug.com/24520 |
| 856 /* |
| 855 test('foreign browser objects should be proxied', () { | 857 test('foreign browser objects should be proxied', () { |
| 856 var iframe = new IFrameElement(); | 858 var iframe = new IFrameElement(); |
| 857 document.body.children.add(iframe); | 859 document.body.children.add(iframe); |
| 858 var proxy = new JsObject.fromBrowserObject(iframe); | 860 var proxy = new JsObject.fromBrowserObject(iframe); |
| 859 | 861 |
| 860 // Window | 862 // Window |
| 861 var contentWindow = proxy['contentWindow']; | 863 var contentWindow = proxy['contentWindow']; |
| 862 expect(contentWindow, isNot(new isInstanceOf<Window>())); | 864 expect(contentWindow, isNot(new isInstanceOf<Window>())); |
| 863 expect(contentWindow, new isInstanceOf<JsObject>()); | 865 expect(contentWindow, new isInstanceOf<JsObject>()); |
| 864 | 866 |
| 865 // Node | 867 // Node |
| 866 var foreignDoc = contentWindow['document']; | 868 var foreignDoc = contentWindow['document']; |
| 867 expect(foreignDoc, isNot(new isInstanceOf<Node>())); | 869 expect(foreignDoc, isNot(new isInstanceOf<Node>())); |
| 868 expect(foreignDoc, new isInstanceOf<JsObject>()); | 870 expect(foreignDoc, new isInstanceOf<JsObject>()); |
| 869 | 871 |
| 870 // Event | 872 // Event |
| 871 var clicked = false; | 873 var clicked = false; |
| 872 foreignDoc['onclick'] = (e) { | 874 foreignDoc['onclick'] = (e) { |
| 873 expect(e, isNot(new isInstanceOf<Event>())); | 875 expect(e, isNot(new isInstanceOf<Event>())); |
| 874 expect(e, new isInstanceOf<JsObject>()); | 876 expect(e, new isInstanceOf<JsObject>()); |
| 875 clicked = true; | 877 clicked = true; |
| 876 }; | 878 }; |
| 877 | 879 |
| 878 context.callMethod('fireClickEvent', [contentWindow]); | 880 context.callMethod('fireClickEvent', [contentWindow]); |
| 879 expect(clicked, isTrue); | 881 expect(clicked, isTrue); |
| 880 }); | 882 }); |
| 883 */ |
| 881 | 884 |
| 882 test('document', () { | 885 test('document', () { |
| 883 expect(context['document'] is Document, isTrue); | 886 expect(context['document'] is Document, isTrue); |
| 884 }); | 887 }); |
| 885 | 888 |
| 886 skipIE9_test('Blob', () { | 889 skipIE9_test('Blob', () { |
| 887 var blob = context.callMethod('getNewBlob'); | 890 var blob = context.callMethod('getNewBlob'); |
| 888 expect(blob is Blob, isTrue); | 891 expect(blob is Blob, isTrue); |
| 889 expect(blob.type, equals('text/html')); | 892 expect(blob.type, equals('text/html')); |
| 890 }); | 893 }); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 // expect(context.callMethod('isPropertyInstanceOf', ['o', listType]), | 1008 // expect(context.callMethod('isPropertyInstanceOf', ['o', listType]), |
| 1006 // isTrue); | 1009 // isTrue); |
| 1007 context.deleteProperty('o'); | 1010 context.deleteProperty('o'); |
| 1008 } | 1011 } |
| 1009 }); | 1012 }); |
| 1010 | 1013 |
| 1011 }); | 1014 }); |
| 1012 }); | 1015 }); |
| 1013 | 1016 |
| 1014 } | 1017 } |
| OLD | NEW |