| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_UNIT_TEST_H_ | 5 #ifndef VM_UNIT_TEST_H_ |
| 6 #define VM_UNIT_TEST_H_ | 6 #define VM_UNIT_TEST_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 #include "vm/ast.h" | 10 #include "vm/ast.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 static Dart_Handle lib(); | 169 static Dart_Handle lib(); |
| 170 static const char* url() { return "dart:test-lib"; } | 170 static const char* url() { return "dart:test-lib"; } |
| 171 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) { | 171 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) { |
| 172 return CreateIsolate(buffer); | 172 return CreateIsolate(buffer); |
| 173 } | 173 } |
| 174 static Dart_Isolate CreateTestIsolate() { | 174 static Dart_Isolate CreateTestIsolate() { |
| 175 return CreateIsolate(NULL); | 175 return CreateIsolate(NULL); |
| 176 } | 176 } |
| 177 static Dart_Handle library_handler(Dart_LibraryTag tag, | 177 static Dart_Handle library_handler(Dart_LibraryTag tag, |
| 178 Dart_Handle library, | 178 Dart_Handle library, |
| 179 Dart_Handle url); | 179 Dart_Handle url, |
| 180 Dart_Handle import_map); |
| 180 | 181 |
| 181 virtual void Run(); | 182 virtual void Run(); |
| 182 | 183 |
| 183 private: | 184 private: |
| 184 static Dart_Isolate CreateIsolate(uint8_t* buffer) { | 185 static Dart_Isolate CreateIsolate(uint8_t* buffer) { |
| 185 char* err; | 186 char* err; |
| 186 Dart_Isolate isolate = Dart_CreateIsolate(NULL, buffer, NULL, &err); | 187 Dart_Isolate isolate = Dart_CreateIsolate(NULL, buffer, NULL, &err); |
| 187 if (isolate == NULL) { | 188 if (isolate == NULL) { |
| 188 OS::Print("Creation of isolate failed '%s'\n", err); | 189 OS::Print("Creation of isolate failed '%s'\n", err); |
| 189 free(err); | 190 free(err); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 280 |
| 280 #define EXPECT_VALID(handle) \ | 281 #define EXPECT_VALID(handle) \ |
| 281 if (Dart_IsError((handle))) { \ | 282 if (Dart_IsError((handle))) { \ |
| 282 dart::Expect(__FILE__, __LINE__).Fail("invalid handle '%s':\n '%s'\n", \ | 283 dart::Expect(__FILE__, __LINE__).Fail("invalid handle '%s':\n '%s'\n", \ |
| 283 #handle, Dart_GetError(handle)); \ | 284 #handle, Dart_GetError(handle)); \ |
| 284 } | 285 } |
| 285 | 286 |
| 286 } // namespace dart | 287 } // namespace dart |
| 287 | 288 |
| 288 #endif // VM_UNIT_TEST_H_ | 289 #endif // VM_UNIT_TEST_H_ |
| OLD | NEW |