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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 349643003: Add a function Dart_AllocateWithNativeFields which allocates an object and sets the native fields i… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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: runtime/vm/dart_api_impl_test.cc
===================================================================
--- runtime/vm/dart_api_impl_test.cc (revision 37560)
+++ runtime/vm/dart_api_impl_test.cc (working copy)
@@ -5316,12 +5316,17 @@
EXPECT_VALID(type);
// Allocate without a constructor.
- Dart_Handle obj = Dart_Allocate(type);
+ const int num_native_fields = 2;
+ const intptr_t native_fields[] = {
+ kNativeArgumentNativeField1Value,
+ kNativeArgumentNativeField2Value
+ };
+ // Allocate and Setup native fields.
+ Dart_Handle obj = Dart_AllocateWithNativeFields(type,
+ num_native_fields,
+ native_fields);
EXPECT_VALID(obj);
- // Setup native fields.
- Dart_SetNativeInstanceField(obj, 0, kNativeArgumentNativeField1Value);
- Dart_SetNativeInstanceField(obj, 1, kNativeArgumentNativeField2Value);
kNativeArgumentNativeField1Value *= 2;
kNativeArgumentNativeField2Value *= 2;
Dart_SetReturnValue(args, obj);

Powered by Google App Engine
This is Rietveld 408576698