| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 postmessage_js_test; | 5 library postmessage_js_test; |
| 6 import '../../pkg/unittest/lib/unittest.dart'; | 6 import '../../pkg/unittest/lib/unittest.dart'; |
| 7 import '../../pkg/unittest/lib/html_individual_config.dart'; | 7 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:collection'; // SplayTreeMap | 9 import 'dart:collection'; // SplayTreeMap |
| 10 import 'dart:typeddata'; |
| 10 import 'utils.dart'; | 11 import 'utils.dart'; |
| 11 | 12 |
| 12 injectSource(code) { | 13 injectSource(code) { |
| 13 final script = new ScriptElement(); | 14 final script = new ScriptElement(); |
| 14 script.type = 'text/javascript'; | 15 script.type = 'text/javascript'; |
| 15 script.innerHtml = code; | 16 script.innerHtml = code; |
| 16 document.body.nodes.add(script); | 17 document.body.nodes.add(script); |
| 17 } | 18 } |
| 18 | 19 |
| 19 main() { | 20 main() { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 go('test_cycle', obj3); | 130 go('test_cycle', obj3); |
| 130 go('test_simple_splay', obj4); | 131 go('test_simple_splay', obj4); |
| 131 go('const_array_1', const [const [1], const [2]]); | 132 go('const_array_1', const [const [1], const [2]]); |
| 132 go('const_array_dag', const [const [1], const [1]]); | 133 go('const_array_dag', const [const [1], const [1]]); |
| 133 go('array_deferred_copy', [1,2,3, obj3, obj3, 6]); | 134 go('array_deferred_copy', [1,2,3, obj3, obj3, 6]); |
| 134 go('array_deferred_copy_2', [1,2,3, [4, 5, obj3], [obj3, 6]]); | 135 go('array_deferred_copy_2', [1,2,3, [4, 5, obj3], [obj3, 6]]); |
| 135 go('cyclic_list', cyclic_list); | 136 go('cyclic_list', cyclic_list); |
| 136 }); | 137 }); |
| 137 | 138 |
| 138 group('typed_arrays', () { | 139 group('typed_arrays', () { |
| 139 var array_buffer = new ArrayBuffer(16); | 140 var array_buffer = new Uint8List(16); |
| 140 var view_a = new Float32Array.fromBuffer(array_buffer, 0, 4); | 141 var view_a = new Float32List.view(array_buffer, 0, 4); |
| 141 var view_b = new Uint8Array.fromBuffer(array_buffer, 1, 13); | 142 var view_b = new Uint8List.view(array_buffer, 1, 13); |
| 142 var typed_arrays_list = [view_a, array_buffer, view_b]; | 143 var typed_arrays_list = [view_a, array_buffer, view_b]; |
| 143 | 144 |
| 144 // Note that FF is failing this test because in the sent message: | 145 // Note that FF is failing this test because in the sent message: |
| 145 // view_a.buffer == array_buffer | 146 // view_a.buffer == array_buffer |
| 146 // But in the response: | 147 // But in the response: |
| 147 // view_a.buffer != array_buffer | 148 // view_a.buffer != array_buffer |
| 148 go('typed_arrays_list', typed_arrays_list); | 149 go('typed_arrays_list', typed_arrays_list); |
| 149 }); | 150 }); |
| 150 | 151 |
| 151 } | 152 } |
| OLD | NEW |