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

Unified Diff: runtime/vm/snapshot_test.cc

Issue 12730013: - Use dart:typedata types in the Dart API calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | sdk/lib/io/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot_test.cc
===================================================================
--- runtime/vm/snapshot_test.cc (revision 19847)
+++ runtime/vm/snapshot_test.cc (working copy)
@@ -613,10 +613,10 @@
uint8_t* buffer;
MessageWriter writer(&buffer, &zone_allocator);
const int kByteArrayLength = 256;
- Uint8Array& byte_array =
- Uint8Array::Handle(Uint8Array::New(kByteArrayLength));
+ TypedData& byte_array = TypedData::Handle(
+ TypedData::New(kTypedDataUint8ArrayCid, kByteArrayLength));
for (int i = 0; i < kByteArrayLength; i++) {
- byte_array.SetAt(i, i);
+ byte_array.SetUint8(i, i);
}
writer.WriteMessage(byte_array);
intptr_t buffer_len = writer.BytesWritten();
@@ -624,9 +624,9 @@
// Read object back from the snapshot.
SnapshotReader reader(buffer, buffer_len,
Snapshot::kMessage, Isolate::Current());
- ByteArray& serialized_byte_array = ByteArray::Handle();
+ TypedData& serialized_byte_array = TypedData::Handle();
serialized_byte_array ^= reader.ReadObject();
- EXPECT(serialized_byte_array.IsByteArray());
+ EXPECT(serialized_byte_array.IsTypedData());
// Read object back from the snapshot into a C structure.
ApiNativeScope scope;
@@ -719,17 +719,17 @@
uint8_t* buffer;
MessageWriter writer(&buffer, &zone_allocator);
const int kByteArrayLength = 0;
- Uint8Array& byte_array =
- Uint8Array::Handle(Uint8Array::New(kByteArrayLength));
+ TypedData& byte_array = TypedData::Handle(
+ TypedData::New(kTypedDataUint8ArrayCid, kByteArrayLength));
writer.WriteMessage(byte_array);
intptr_t buffer_len = writer.BytesWritten();
// Read object back from the snapshot.
SnapshotReader reader(buffer, buffer_len,
Snapshot::kMessage, Isolate::Current());
- ByteArray& serialized_byte_array = ByteArray::Handle();
+ TypedData& serialized_byte_array = TypedData::Handle();
serialized_byte_array ^= reader.ReadObject();
- EXPECT(serialized_byte_array.IsByteArray());
+ EXPECT(serialized_byte_array.IsTypedData());
// Read object back from the snapshot into a C structure.
ApiNativeScope scope;
@@ -1763,7 +1763,7 @@
UNIT_TEST_CASE(DartGeneratedListMessagesWithBackref) {
const int kArrayLength = 10;
static const char* kScriptChars =
- "import 'dart:scalarlist';\n"
+ "import 'dart:typeddata';\n"
"final int kArrayLength = 10;\n"
"getStringList() {\n"
" var s = 'Hello, world!';\n"
@@ -1934,7 +1934,7 @@
UNIT_TEST_CASE(DartGeneratedArrayLiteralMessagesWithBackref) {
const int kArrayLength = 10;
static const char* kScriptChars =
- "import 'dart:scalarlist';\n"
+ "import 'dart:typeddata';\n"
"final int kArrayLength = 10;\n"
"getStringList() {\n"
" var s = 'Hello, world!';\n"
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | sdk/lib/io/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698