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

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

Issue 1403693002: - Implement package map parameter when spawning isolate. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments. Created 5 years, 2 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
« no previous file with comments | « runtime/lib/isolate_patch.dart ('k') | runtime/vm/isolate.h » ('j') | 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_mirrors_api.h" 7 #include "include/dart_mirrors_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "include/dart_tools_api.h" 9 #include "include/dart_tools_api.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 7545 matching lines...) Expand 10 before | Expand all | Expand 10 after
7556 7556
7557 // Delete the native ports. 7557 // Delete the native ports.
7558 EXPECT(Dart_CloseNativePort(port_id1)); 7558 EXPECT(Dart_CloseNativePort(port_id1));
7559 EXPECT(Dart_CloseNativePort(port_id2)); 7559 EXPECT(Dart_CloseNativePort(port_id2));
7560 } 7560 }
7561 7561
7562 7562
7563 static Dart_Isolate RunLoopTestCallback(const char* script_name, 7563 static Dart_Isolate RunLoopTestCallback(const char* script_name,
7564 const char* main, 7564 const char* main,
7565 const char* package_root, 7565 const char* package_root,
7566 const char** package_map,
7566 Dart_IsolateFlags* flags, 7567 Dart_IsolateFlags* flags,
7567 void* data, 7568 void* data,
7568 char** error) { 7569 char** error) {
7569 const char* kScriptChars = 7570 const char* kScriptChars =
7570 "import 'builtin';\n" 7571 "import 'builtin';\n"
7571 "import 'dart:isolate';\n" 7572 "import 'dart:isolate';\n"
7572 "void entry(message) {\n" 7573 "void entry(message) {\n"
7573 " var data = message[0];\n" 7574 " var data = message[0];\n"
7574 " var replyTo = message[1];\n" 7575 " var replyTo = message[1];\n"
7575 " if (data) {\n" 7576 " if (data) {\n"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
7630 } 7631 }
7631 7632
7632 7633
7633 // Common code for RunLoop_Success/RunLoop_Failure. 7634 // Common code for RunLoop_Success/RunLoop_Failure.
7634 static void RunLoopTest(bool throw_exception_child, 7635 static void RunLoopTest(bool throw_exception_child,
7635 bool throw_exception_parent) { 7636 bool throw_exception_parent) {
7636 Dart_IsolateCreateCallback saved = Isolate::CreateCallback(); 7637 Dart_IsolateCreateCallback saved = Isolate::CreateCallback();
7637 Isolate::SetCreateCallback(RunLoopTestCallback); 7638 Isolate::SetCreateCallback(RunLoopTestCallback);
7638 Isolate::SetUnhandledExceptionCallback(RunLoopUnhandledExceptionCallback); 7639 Isolate::SetUnhandledExceptionCallback(RunLoopUnhandledExceptionCallback);
7639 Dart_Isolate isolate = RunLoopTestCallback( 7640 Dart_Isolate isolate = RunLoopTestCallback(
7640 NULL, NULL, NULL, NULL, NULL, NULL); 7641 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
7641 7642
7642 Dart_EnterIsolate(isolate); 7643 Dart_EnterIsolate(isolate);
7643 Dart_EnterScope(); 7644 Dart_EnterScope();
7644 Dart_Handle lib = Dart_LookupLibrary(NewString(TestCase::url())); 7645 Dart_Handle lib = Dart_LookupLibrary(NewString(TestCase::url()));
7645 EXPECT_VALID(lib); 7646 EXPECT_VALID(lib);
7646 7647
7647 Dart_Handle result; 7648 Dart_Handle result;
7648 Dart_Handle args[2]; 7649 Dart_Handle args[2];
7649 args[0] = (throw_exception_child ? Dart_True() : Dart_False()); 7650 args[0] = (throw_exception_child ? Dart_True() : Dart_False());
7650 args[1] = (throw_exception_parent ? Dart_True() : Dart_False()); 7651 args[1] = (throw_exception_parent ? Dart_True() : Dart_False());
(...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after
9778 9779
9779 // Heartbeat test for new events. 9780 // Heartbeat test for new events.
9780 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); 9781 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer);
9781 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); 9782 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer);
9782 9783
9783 // Free buffer allocated by AppendStreamConsumer 9784 // Free buffer allocated by AppendStreamConsumer
9784 free(data.buffer); 9785 free(data.buffer);
9785 } 9786 }
9786 9787
9787 } // namespace dart 9788 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/isolate_patch.dart ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698