Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: tests/html/typed_arrays_range_checks_test.dart

Issue 14367012: Move to new dart:typeddata types for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert generated files for html lib Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/html/typed_arrays_range_checks_test.dart
diff --git a/tests/html/typed_arrays_range_checks_test.dart b/tests/html/typed_arrays_range_checks_test.dart
index 5707dce7798299a03fc0423f97b18cf2c665bf8f..696d9cdd544d24352bffd21a79eeef93058b87d6 100644
--- a/tests/html/typed_arrays_range_checks_test.dart
+++ b/tests/html/typed_arrays_range_checks_test.dart
@@ -6,6 +6,7 @@ library TypedArraysRangeCheckTest;
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_config.dart';
import 'dart:html';
+import 'dart:typeddata';
main() {
useHtmlConfiguration();
@@ -16,20 +17,20 @@ main() {
}
test('outOfRangeAccess_dynamic', () {
- var a = new Uint8Array(1024);
+ var a = new Uint8List(1024);
- expect(a[a.length], isNull);
- expect(a[a.length + 1], isNull);
- expect(a[a.length + 1024], isNull);
+ expect(() => a[a.length], throws);
+ expect(() => a[a.length + 1], throws);
+ expect(() => a[a.length + 1024], throws);
// expect(a[-1], isNull);
// expect(a[-2], isNull);
// expect(a[-1024], isNull);
// It's harder to test out of range setters, but let's do some minimum.
- a[a.length] = 0xdeadbeaf;
- a[a.length + 1] = 0xdeadbeaf;
- a[a.length + 1024] = 0xdeadbeaf;
+ expect(() => a[a.length] = 0xdeadbeaf, throws);
+ expect(() => a[a.length + 1] = 0xdeadbeaf, throws);
+ expect(() => a[a.length + 1024] = 0xdeadbeaf, throws);
// a[-1] = 0xdeadbeaf;
// a[-2] = 0xdeadbeaf;
@@ -37,20 +38,20 @@ main() {
});
test('outOfRange_typed', () {
- Uint8Array a = new Uint8Array(1024);
+ Uint8List a = new Uint8List(1024);
- expect(a[a.length], isNull);
- expect(a[a.length + 1], isNull);
- expect(a[a.length + 1024], isNull);
+ expect(() => a[a.length], throws);
+ expect(() => a[a.length + 1], throws);
+ expect(() => a[a.length + 1024], throws);
// expect(a[-1], isNull);
// expect(a[-2], isNull);
// expect(a[-1024], isNull);
// It's harder to test out of range setters, but let's do some minimum.
- a[a.length] = 0xdeadbeaf;
- a[a.length + 1] = 0xdeadbeaf;
- a[a.length + 1024] = 0xdeadbeaf;
+ expect(() => a[a.length] = 0xdeadbeaf, throws);
+ expect(() => a[a.length + 1] = 0xdeadbeaf, throws);
+ expect(() => a[a.length + 1024] = 0xdeadbeaf, throws);
// a[-1] = 0xdeadbeaf;
// a[-2] = 0xdeadbeaf;

Powered by Google App Engine
This is Rietveld 408576698