| OLD | NEW |
| 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_debugger_api.h" | 7 #include "include/dart_debugger_api.h" |
| 8 #include "include/dart_mirrors_api.h" | 8 #include "include/dart_mirrors_api.h" |
| 9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 7109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7120 " receivePort.handler = (message) {\n" | 7120 " receivePort.handler = (message) {\n" |
| 7121 " receivePort.close();\n" | 7121 " receivePort.close();\n" |
| 7122 " if (message != 'hello') throw new Exception('ShouldNotHappen');\n" | 7122 " if (message != 'hello') throw new Exception('ShouldNotHappen');\n" |
| 7123 " if (exc_parent) throw new Exception('MakeParentExit');\n" | 7123 " if (exc_parent) throw new Exception('MakeParentExit');\n" |
| 7124 " };\n" | 7124 " };\n" |
| 7125 "}\n"; | 7125 "}\n"; |
| 7126 | 7126 |
| 7127 if (Dart_CurrentIsolate() != NULL) { | 7127 if (Dart_CurrentIsolate() != NULL) { |
| 7128 Dart_ExitIsolate(); | 7128 Dart_ExitIsolate(); |
| 7129 } | 7129 } |
| 7130 Dart_Isolate isolate = TestCase::CreateTestIsolate(); | 7130 Dart_Isolate isolate = TestCase::CreateTestIsolate(script_name); |
| 7131 ASSERT(isolate != NULL); | 7131 ASSERT(isolate != NULL); |
| 7132 if (Dart_IsServiceIsolate(isolate)) { |
| 7133 return isolate; |
| 7134 } |
| 7132 Dart_EnterScope(); | 7135 Dart_EnterScope(); |
| 7133 Dart_Handle url = NewString(TestCase::url()); | 7136 Dart_Handle url = NewString(TestCase::url()); |
| 7134 Dart_Handle source = NewString(kScriptChars); | 7137 Dart_Handle source = NewString(kScriptChars); |
| 7135 Dart_Handle result = Dart_SetLibraryTagHandler(TestCase::library_handler); | 7138 Dart_Handle result = Dart_SetLibraryTagHandler(TestCase::library_handler); |
| 7136 EXPECT_VALID(result); | 7139 EXPECT_VALID(result); |
| 7137 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); | 7140 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); |
| 7138 EXPECT_VALID(lib); | 7141 EXPECT_VALID(lib); |
| 7139 result = Dart_FinalizeLoading(false); | 7142 result = Dart_FinalizeLoading(false); |
| 7140 EXPECT_VALID(result); | 7143 EXPECT_VALID(result); |
| 7141 Dart_ExitScope(); | 7144 Dart_ExitScope(); |
| (...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8813 result = Dart_Invoke(lib, | 8816 result = Dart_Invoke(lib, |
| 8814 NewString("testView16"), | 8817 NewString("testView16"), |
| 8815 1, | 8818 1, |
| 8816 dart_args); | 8819 dart_args); |
| 8817 EXPECT_VALID(result); | 8820 EXPECT_VALID(result); |
| 8818 EXPECT(Dart_IsString(result)); | 8821 EXPECT(Dart_IsString(result)); |
| 8819 } | 8822 } |
| 8820 } | 8823 } |
| 8821 | 8824 |
| 8822 } // namespace dart | 8825 } // namespace dart |
| OLD | NEW |