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

Unified Diff: runtime/vm/snapshot_test.cc

Issue 243973002: - Add a minimal implementation of Capability. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/symbols.h » ('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 35287)
+++ runtime/vm/snapshot_test.cc (working copy)
@@ -2643,53 +2643,50 @@
" messageCount++;\n"
" if (messageCount == 9) throw new Exception(exception);\n"
" };\n"
- " return port.sendPort;\n"
+ " return port;\n"
"}\n";
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
Dart_EnterScope();
- Dart_Handle send_port = Dart_Invoke(lib, NewString("main"), 0, NULL);
- EXPECT_VALID(send_port);
- Dart_Handle result = Dart_GetField(send_port, NewString("_id"));
+ Dart_Handle recv_port = Dart_Invoke(lib, NewString("main"), 0, NULL);
+ EXPECT_VALID(recv_port);
+ Dart_Port port_id;
+ Dart_Handle result = Dart_ReceivePortGetId(recv_port, &port_id);
ASSERT(!Dart_IsError(result));
- ASSERT(Dart_IsInteger(result));
- int64_t send_port_id;
- Dart_Handle result2 = Dart_IntegerToInt64(result, &send_port_id);
- ASSERT(!Dart_IsError(result2));
// Setup single object message.
Dart_CObject object;
object.type = Dart_CObject_kNull;
- EXPECT(Dart_PostCObject(send_port_id, &object));
+ EXPECT(Dart_PostCObject(port_id, &object));
object.type = Dart_CObject_kBool;
object.value.as_bool = true;
- EXPECT(Dart_PostCObject(send_port_id, &object));
+ EXPECT(Dart_PostCObject(port_id, &object));
object.type = Dart_CObject_kBool;
object.value.as_bool = false;
- EXPECT(Dart_PostCObject(send_port_id, &object));
+ EXPECT(Dart_PostCObject(port_id, &object));
object.type = Dart_CObject_kInt32;
object.value.as_int32 = 123;
- EXPECT(Dart_PostCObject(send_port_id, &object));
+ EXPECT(Dart_PostCObject(port_id, &object));
object.type = Dart_CObject_kString;
object.value.as_string = const_cast<char*>("456");
- EXPECT(Dart_PostCObject(send_port_id, &object));
+ EXPECT(Dart_PostCObject(port_id, &object));
object.type = Dart_CObject_kString;
object.value.as_string = const_cast<char*>("æøå");
- EXPECT(Dart_PostCObject(send_port_id, &object));
+ EXPECT(Dart_PostCObject(port_id, &object));
object.type = Dart_CObject_kDouble;
object.value.as_double = 3.14;
- EXPECT(Dart_PostCObject(send_port_id, &object));
+ EXPECT(Dart_PostCObject(port_id, &object));
object.type = Dart_CObject_kArray;
object.value.as_array.length = 0;
- EXPECT(Dart_PostCObject(send_port_id, &object));
+ EXPECT(Dart_PostCObject(port_id, &object));
static const int kArrayLength = 10;
Dart_CObject* array =
@@ -2708,7 +2705,7 @@
element->value.as_int32 = i;
array->value.as_array.values[i] = element;
}
- EXPECT(Dart_PostCObject(send_port_id, array));
+ EXPECT(Dart_PostCObject(port_id, array));
result = Dart_RunLoop();
EXPECT(Dart_IsError(result));
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698