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

Side by Side Diff: runtime/vm/dart_api_impl_test.cc

Issue 148453016: Add new Dart API function Dart_IsolateData which returns the peer isolate data associated with an i… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "bin/builtin.h" 5 #include "bin/builtin.h"
6 #include "include/dart_api.h" 6 #include "include/dart_api.h"
7 #include "include/dart_debugger_api.h" 7 #include "include/dart_debugger_api.h"
8 #include "include/dart_mirrors_api.h" 8 #include "include/dart_mirrors_api.h"
9 #include "include/dart_native_api.h" 9 #include "include/dart_native_api.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after
3052 3052
3053 UNIT_TEST_CASE(CurrentIsolateData) { 3053 UNIT_TEST_CASE(CurrentIsolateData) {
3054 intptr_t mydata = 12345; 3054 intptr_t mydata = 12345;
3055 char* err; 3055 char* err;
3056 Dart_Isolate isolate = 3056 Dart_Isolate isolate =
3057 Dart_CreateIsolate(NULL, NULL, bin::snapshot_buffer, 3057 Dart_CreateIsolate(NULL, NULL, bin::snapshot_buffer,
3058 reinterpret_cast<void*>(mydata), 3058 reinterpret_cast<void*>(mydata),
3059 &err); 3059 &err);
3060 EXPECT(isolate != NULL); 3060 EXPECT(isolate != NULL);
3061 EXPECT_EQ(mydata, reinterpret_cast<intptr_t>(Dart_CurrentIsolateData())); 3061 EXPECT_EQ(mydata, reinterpret_cast<intptr_t>(Dart_CurrentIsolateData()));
3062 EXPECT_EQ(mydata, reinterpret_cast<intptr_t>(Dart_IsolateData(isolate)));
3062 Dart_ShutdownIsolate(); 3063 Dart_ShutdownIsolate();
3063 } 3064 }
3064 3065
3065 3066
3066 TEST_CASE(DebugName) { 3067 TEST_CASE(DebugName) {
3067 Dart_Handle debug_name = Dart_DebugName(); 3068 Dart_Handle debug_name = Dart_DebugName();
3068 EXPECT_VALID(debug_name); 3069 EXPECT_VALID(debug_name);
3069 EXPECT(Dart_IsString(debug_name)); 3070 EXPECT(Dart_IsString(debug_name));
3070 } 3071 }
3071 3072
(...skipping 4757 matching lines...) Expand 10 before | Expand all | Expand 10 after
7829 NewString("main"), 7830 NewString("main"),
7830 1, 7831 1,
7831 dart_args); 7832 dart_args);
7832 int64_t value = 0; 7833 int64_t value = 0;
7833 result = Dart_IntegerToInt64(result, &value); 7834 result = Dart_IntegerToInt64(result, &value);
7834 EXPECT_VALID(result); 7835 EXPECT_VALID(result);
7835 EXPECT_EQ(6, value); 7836 EXPECT_EQ(6, value);
7836 } 7837 }
7837 7838
7838 } // namespace dart 7839 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698