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

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

Issue 1263513002: VM: Load allocation-top and -end via Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed cc tests Created 5 years, 4 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 "include/dart_api.h"
5 #include "platform/assert.h" 6 #include "platform/assert.h"
6 #include "vm/globals.h" 7 #include "vm/globals.h"
7 #include "vm/isolate.h" 8 #include "vm/isolate.h"
8 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
9 10
10 namespace dart { 11 namespace dart {
11 12
12 UNIT_TEST_CASE(IsolateCurrent) { 13 UNIT_TEST_CASE(IsolateCurrent) {
13 Isolate::Flags vm_flags; 14 Dart_Isolate isolate = Dart_CreateIsolate(
14 Dart_IsolateFlags api_flags; 15 NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
15 vm_flags.CopyTo(&api_flags); 16 EXPECT_EQ(isolate, Dart_CurrentIsolate());
16 Isolate* isolate = Isolate::Init(NULL, api_flags); 17 Dart_ShutdownIsolate();
17 EXPECT_EQ(isolate, Isolate::Current()); 18 EXPECT_EQ(reinterpret_cast<Dart_Isolate>(NULL), Dart_CurrentIsolate());
18 isolate->Shutdown();
19 EXPECT_EQ(reinterpret_cast<Isolate*>(NULL), Isolate::Current());
20 delete isolate;
21 } 19 }
22 20
23 21
24 // Test to ensure that an exception is thrown if no isolate creation 22 // Test to ensure that an exception is thrown if no isolate creation
25 // callback has been set by the embedder when an isolate is spawned. 23 // callback has been set by the embedder when an isolate is spawned.
26 TEST_CASE(IsolateSpawn) { 24 TEST_CASE(IsolateSpawn) {
27 const char* kScriptChars = 25 const char* kScriptChars =
28 "import 'dart:isolate';\n" 26 "import 'dart:isolate';\n"
29 // Ignores printed lines. 27 // Ignores printed lines.
30 "var _nullPrintClosure = (String line) {};\n" 28 "var _nullPrintClosure = (String line) {};\n"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 EXPECT(!Dart_IsError(result)); 74 EXPECT(!Dart_IsError(result));
77 // Run until all ports to isolate are closed. 75 // Run until all ports to isolate are closed.
78 result = Dart_RunLoop(); 76 result = Dart_RunLoop();
79 EXPECT_ERROR(result, "Null callback specified for isolate creation"); 77 EXPECT_ERROR(result, "Null callback specified for isolate creation");
80 EXPECT(Dart_ErrorHasException(result)); 78 EXPECT(Dart_ErrorHasException(result));
81 Dart_Handle exception_result = Dart_ErrorGetException(result); 79 Dart_Handle exception_result = Dart_ErrorGetException(result);
82 EXPECT_VALID(exception_result); 80 EXPECT_VALID(exception_result);
83 } 81 }
84 82
85 } // namespace dart 83 } // namespace dart
OLDNEW
« runtime/vm/isolate.h ('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