| 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 typed_arrays_arraybuffer_test; | |
| 6 import 'package:unittest/unittest.dart'; | |
| 7 import 'package:unittest/html_config.dart'; | |
| 8 import 'dart:html'; | 5 import 'dart:html'; |
| 9 import 'dart:typed_data'; | 6 import 'dart:typed_data'; |
| 10 | 7 |
| 8 import 'package:expect/minitest.dart'; |
| 9 |
| 11 main() { | 10 main() { |
| 12 useHtmlConfiguration(); | |
| 13 | |
| 14 // Only perform tests if ArrayBuffer is supported. | 11 // Only perform tests if ArrayBuffer is supported. |
| 15 if (!Platform.supportsTypedData) { | 12 if (!Platform.supportsTypedData) { |
| 16 return; | 13 return; |
| 17 } | 14 } |
| 18 | 15 |
| 19 test('constructor', () { | 16 test('constructor', () { |
| 20 var a = new Int8List(100); | 17 var a = new Int8List(100); |
| 21 expect(a.lengthInBytes, 100); | 18 expect(a.lengthInBytes, 100); |
| 22 }); | 19 }); |
| 23 | 20 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 35 test('sublist3', () { | 32 test('sublist3', () { |
| 36 var a = new Int8List(100); | 33 var a = new Int8List(100); |
| 37 expect(() => a.sublist(50, 10), throwsRangeError); | 34 expect(() => a.sublist(50, 10), throwsRangeError); |
| 38 }); | 35 }); |
| 39 | 36 |
| 40 test('sublist4', () { | 37 test('sublist4', () { |
| 41 var a = new Int8List(100); | 38 var a = new Int8List(100); |
| 42 expect(() => a.sublist(-90, -30), throwsRangeError); | 39 expect(() => a.sublist(-90, -30), throwsRangeError); |
| 43 }); | 40 }); |
| 44 } | 41 } |
| OLD | NEW |