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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 static Dart_Handle lib(); | 174 static Dart_Handle lib(); |
175 static const char* url() { return "dart:test-lib"; } | 175 static const char* url() { return "dart:test-lib"; } |
176 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) { | 176 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) { |
177 return CreateIsolate(buffer); | 177 return CreateIsolate(buffer); |
178 } | 178 } |
179 static Dart_Isolate CreateTestIsolate() { | 179 static Dart_Isolate CreateTestIsolate() { |
180 return CreateIsolate(NULL); | 180 return CreateIsolate(NULL); |
181 } | 181 } |
182 static Dart_Handle library_handler(Dart_LibraryTag tag, | 182 static Dart_Handle library_handler(Dart_LibraryTag tag, |
183 Dart_Handle library, | 183 Dart_Handle library, |
184 Dart_Handle url); | 184 Dart_Handle url, |
| 185 Dart_Handle import_map); |
185 | 186 |
186 virtual void Run(); | 187 virtual void Run(); |
187 | 188 |
188 private: | 189 private: |
189 static Dart_Isolate CreateIsolate(uint8_t* buffer) { | 190 static Dart_Isolate CreateIsolate(uint8_t* buffer) { |
190 char* err; | 191 char* err; |
191 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, buffer, NULL, &err); | 192 Dart_Isolate isolate = Dart_CreateIsolate(NULL, buffer, NULL, &err); |
192 if (isolate == NULL) { | 193 if (isolate == NULL) { |
193 OS::Print("Creation of isolate failed '%s'\n", err); | 194 OS::Print("Creation of isolate failed '%s'\n", err); |
194 free(err); | 195 free(err); |
195 } | 196 } |
196 EXPECT(isolate != NULL); | 197 EXPECT(isolate != NULL); |
197 return isolate; | 198 return isolate; |
198 } | 199 } |
199 | 200 |
200 RunEntry* const run_; | 201 RunEntry* const run_; |
201 }; | 202 }; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 } else { \ | 305 } else { \ |
305 dart::Expect(__FILE__, __LINE__).Fail( \ | 306 dart::Expect(__FILE__, __LINE__).Fail( \ |
306 "expected '%s' to be an error handle but found a valid handle.\n", \ | 307 "expected '%s' to be an error handle but found a valid handle.\n", \ |
307 #handle); \ | 308 #handle); \ |
308 } \ | 309 } \ |
309 } while (0) | 310 } while (0) |
310 | 311 |
311 } // namespace dart | 312 } // namespace dart |
312 | 313 |
313 #endif // VM_UNIT_TEST_H_ | 314 #endif // VM_UNIT_TEST_H_ |
OLD | NEW |