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

Unified Diff: tests/html/utils.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/utils.dart
diff --git a/tests/html/utils.dart b/tests/html/utils.dart
index 3257661e93ae9f514045b9bd150ecfe06901f54c..cac5559d8cd88a509d61a38681b16cfe4ba2a918 100644
--- a/tests/html/utils.dart
+++ b/tests/html/utils.dart
@@ -2,6 +2,7 @@ library TestUtils;
import 'dart:async';
import 'dart:html';
+import 'dart:typeddata';
import '../../pkg/unittest/lib/unittest.dart';
/**
@@ -40,24 +41,24 @@ verifyGraph(expected, actual) {
eItems.add(expected);
aItems.add(actual);
- if (expected is ArrayBuffer) {
- expect(actual is ArrayBuffer, isTrue,
- reason: '$actual is ArrayBuffer');
- expect(expected.byteLength, equals(actual.byteLength),
- reason: message(path, '.byteLength'));
+ if (expected is ByteBuffer) {
+ expect(actual is ByteBuffer, isTrue,
+ reason: '$actual is ByteBuffer');
+ expect(expected.lengthInBytes, equals(actual.lengthInBytes),
+ reason: message(path, '.lengthInBytes'));
// TODO(antonm): one can create a view on top of those
// and check if contents identical. Let's do it later.
return;
}
- if (expected is ArrayBufferView) {
- expect(actual is ArrayBufferView, isTrue,
- reason: '$actual is ArrayBufferView');
+ if (expected is TypedData) {
+ expect(actual is TypedData, isTrue,
+ reason: '$actual is TypedData');
walk('$path/.buffer', expected.buffer, actual.buffer);
- expect(expected.byteOffset, equals(actual.byteOffset),
- reason: message(path, '.byteOffset'));
- expect(expected.byteLength, equals(actual.byteLength),
- reason: message(path, '.byteLength'));
+ expect(expected.offsetInBytes, equals(actual.offsetInBytes),
+ reason: message(path, '.offsetInBytes'));
+ expect(expected.lengthInBytes, equals(actual.lengthInBytes),
+ reason: message(path, '.lengthInBytes'));
// And also fallback to elements check below.
}

Powered by Google App Engine
This is Rietveld 408576698