Index: runtime/vm/zone_test.cc |
diff --git a/runtime/vm/zone_test.cc b/runtime/vm/zone_test.cc |
index 580f9686727c839990217e393db33015221a9ee9..da5f208189d52c6353ea51365dda128a925c06ab 100644 |
--- a/runtime/vm/zone_test.cc |
+++ b/runtime/vm/zone_test.cc |
@@ -16,11 +16,9 @@ UNIT_TEST_CASE(AllocateZone) { |
#if defined(DEBUG) |
FLAG_trace_zones = true; |
#endif |
- Isolate::Flags vm_flags; |
- Dart_IsolateFlags api_flags; |
- vm_flags.CopyTo(&api_flags); |
- Isolate* isolate = Isolate::Init(NULL, api_flags); |
- EXPECT(Isolate::Current() == isolate); |
+ Dart_CreateIsolate( |
+ NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL); |
+ Isolate* isolate = Isolate::Current(); |
EXPECT(isolate->current_zone() == NULL); |
{ |
StackZone stack_zone(isolate); |
@@ -72,8 +70,7 @@ UNIT_TEST_CASE(AllocateZone) { |
EXPECT_LE(allocated_size, zone->SizeInBytes()); |
} |
EXPECT(isolate->current_zone() == NULL); |
- isolate->Shutdown(); |
- delete isolate; |
+ Dart_ShutdownIsolate(); |
} |
@@ -81,11 +78,9 @@ UNIT_TEST_CASE(AllocGeneric_Success) { |
#if defined(DEBUG) |
FLAG_trace_zones = true; |
#endif |
- Isolate::Flags vm_flags; |
- Dart_IsolateFlags api_flags; |
- vm_flags.CopyTo(&api_flags); |
- Isolate* isolate = Isolate::Init(NULL, api_flags); |
- EXPECT(Isolate::Current() == isolate); |
+ Dart_CreateIsolate( |
+ NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL); |
+ Isolate* isolate = Isolate::Current(); |
EXPECT(isolate->current_zone() == NULL); |
{ |
StackZone zone(isolate); |
@@ -98,8 +93,7 @@ UNIT_TEST_CASE(AllocGeneric_Success) { |
EXPECT_LE(allocated_size, zone.SizeInBytes()); |
} |
EXPECT(isolate->current_zone() == NULL); |
- isolate->Shutdown(); |
- delete isolate; |
+ Dart_ShutdownIsolate(); |
} |
@@ -108,11 +102,9 @@ UNIT_TEST_CASE(AllocGeneric_Overflow) { |
#if defined(DEBUG) |
FLAG_trace_zones = true; |
#endif |
- Isolate::Flags vm_flags; |
- Dart_IsolateFlags api_flags; |
- vm_flags.CopyTo(&api_flags); |
- Isolate* isolate = Isolate::Init(NULL, api_flags); |
- EXPECT(Isolate::Current() == isolate); |
+ Dart_CreateIsolate( |
+ NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL); |
+ Isolate* isolate = Isolate::Current(); |
EXPECT(isolate->current_zone() == NULL); |
{ |
StackZone zone(isolate); |
@@ -121,8 +113,7 @@ UNIT_TEST_CASE(AllocGeneric_Overflow) { |
const intptr_t kNumElements = (kIntptrMax / sizeof(uint32_t)) + 1; |
zone.GetZone()->Alloc<uint32_t>(kNumElements); |
} |
- isolate->Shutdown(); |
- delete isolate; |
+ Dart_ShutdownIsolate(); |
} |
@@ -130,11 +121,9 @@ UNIT_TEST_CASE(ZoneAllocated) { |
#if defined(DEBUG) |
FLAG_trace_zones = true; |
#endif |
- Isolate::Flags vm_flags; |
- Dart_IsolateFlags api_flags; |
- vm_flags.CopyTo(&api_flags); |
- Isolate* isolate = Isolate::Init(NULL, api_flags); |
- EXPECT(Isolate::Current() == isolate); |
+ Dart_CreateIsolate( |
+ NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL); |
+ Isolate* isolate = Isolate::Current(); |
EXPECT(isolate->current_zone() == NULL); |
static int marker; |
@@ -172,8 +161,7 @@ UNIT_TEST_CASE(ZoneAllocated) { |
EXPECT_EQ(87, second->slot); |
} |
EXPECT(isolate->current_zone() == NULL); |
- isolate->Shutdown(); |
- delete isolate; |
+ Dart_ShutdownIsolate(); |
} |