| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 | 160 |
| 161 class TestCase : TestCaseBase { | 161 class TestCase : TestCaseBase { |
| 162 public: | 162 public: |
| 163 typedef void (RunEntry)(); | 163 typedef void (RunEntry)(); |
| 164 | 164 |
| 165 TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) { } | 165 TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) { } |
| 166 | 166 |
| 167 static Dart_Handle LoadTestScript(const char* script, | 167 static Dart_Handle LoadTestScript(const char* script, |
| 168 Dart_NativeEntryResolver resolver); | 168 Dart_NativeEntryResolver resolver) { |
| 169 return LoadTestScript(script, resolver, Dart_NewList(0)); |
| 170 } |
| 171 static Dart_Handle LoadTestScript(const char* script, |
| 172 Dart_NativeEntryResolver resolver, |
| 173 Dart_Handle import_map); |
| 169 static Dart_Handle lib(); | 174 static Dart_Handle lib(); |
| 170 static const char* url() { return "dart:test-lib"; } | 175 static const char* url() { return "dart:test-lib"; } |
| 171 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) { | 176 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) { |
| 172 return CreateIsolate(buffer); | 177 return CreateIsolate(buffer); |
| 173 } | 178 } |
| 174 static Dart_Isolate CreateTestIsolate() { | 179 static Dart_Isolate CreateTestIsolate() { |
| 175 return CreateIsolate(NULL); | 180 return CreateIsolate(NULL); |
| 176 } | 181 } |
| 177 static Dart_Handle library_handler(Dart_LibraryTag tag, | 182 static Dart_Handle library_handler(Dart_LibraryTag tag, |
| 178 Dart_Handle library, | 183 Dart_Handle library, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } else { \ | 303 } else { \ |
| 299 dart::Expect(__FILE__, __LINE__).Fail( \ | 304 dart::Expect(__FILE__, __LINE__).Fail( \ |
| 300 "expected '%s' to be an error handle but found a valid handle.\n", \ | 305 "expected '%s' to be an error handle but found a valid handle.\n", \ |
| 301 #handle); \ | 306 #handle); \ |
| 302 } \ | 307 } \ |
| 303 } while (0) | 308 } while (0) |
| 304 | 309 |
| 305 } // namespace dart | 310 } // namespace dart |
| 306 | 311 |
| 307 #endif // VM_UNIT_TEST_H_ | 312 #endif // VM_UNIT_TEST_H_ |
| OLD | NEW |