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

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

Issue 1162033005: Fix http://dartbug.com/23578: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update to ToT. Created 5 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 unified diff | Download patch
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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/globals.h" 6 #include "vm/globals.h"
7 #include "vm/isolate.h" 7 #include "vm/isolate.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 UNIT_TEST_CASE(IsolateCurrent) { 12 UNIT_TEST_CASE(IsolateCurrent) {
13 Isolate* isolate = Isolate::Init(NULL); 13 Isolate::Flags vm_flags;
14 Dart_IsolateFlags api_flags;
15 vm_flags.CopyTo(&api_flags);
16 Isolate* isolate = Isolate::Init(NULL, api_flags);
14 EXPECT_EQ(isolate, Isolate::Current()); 17 EXPECT_EQ(isolate, Isolate::Current());
15 isolate->Shutdown(); 18 isolate->Shutdown();
16 EXPECT_EQ(reinterpret_cast<Isolate*>(NULL), Isolate::Current()); 19 EXPECT_EQ(reinterpret_cast<Isolate*>(NULL), Isolate::Current());
17 delete isolate; 20 delete isolate;
18 } 21 }
19 22
20 23
21 // Test to ensure that an exception is thrown if no isolate creation 24 // Test to ensure that an exception is thrown if no isolate creation
22 // callback has been set by the embedder when an isolate is spawned. 25 // callback has been set by the embedder when an isolate is spawned.
23 TEST_CASE(IsolateSpawn) { 26 TEST_CASE(IsolateSpawn) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 EXPECT(!Dart_IsError(result)); 76 EXPECT(!Dart_IsError(result));
74 // Run until all ports to isolate are closed. 77 // Run until all ports to isolate are closed.
75 result = Dart_RunLoop(); 78 result = Dart_RunLoop();
76 EXPECT_ERROR(result, "Null callback specified for isolate creation"); 79 EXPECT_ERROR(result, "Null callback specified for isolate creation");
77 EXPECT(Dart_ErrorHasException(result)); 80 EXPECT(Dart_ErrorHasException(result));
78 Dart_Handle exception_result = Dart_ErrorGetException(result); 81 Dart_Handle exception_result = Dart_ErrorGetException(result);
79 EXPECT_VALID(exception_result); 82 EXPECT_VALID(exception_result);
80 } 83 }
81 84
82 } // namespace dart 85 } // namespace dart
OLDNEW
« runtime/vm/isolate.cc ('K') | « runtime/vm/isolate.cc ('k') | runtime/vm/metrics_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698