| 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 RUNTIME_VM_UNIT_TEST_H_ | 5 #ifndef RUNTIME_VM_UNIT_TEST_H_ |
| 6 #define RUNTIME_VM_UNIT_TEST_H_ | 6 #define RUNTIME_VM_UNIT_TEST_H_ |
| 7 | 7 |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 | 9 |
| 10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 class VirtualMemory; | 240 class VirtualMemory; |
| 241 | 241 |
| 242 | 242 |
| 243 namespace bin { | 243 namespace bin { |
| 244 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we | 244 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we |
| 245 // link in a snapshot otherwise it is initialized to NULL. | 245 // link in a snapshot otherwise it is initialized to NULL. |
| 246 extern const uint8_t* vm_isolate_snapshot_buffer; | 246 extern const uint8_t* vm_isolate_snapshot_buffer; |
| 247 | 247 |
| 248 // isolate_snapshot_buffer points to a snapshot for an isolate if we link in a | 248 // isolate_snapshot_buffer points to a snapshot for an isolate if we link in a |
| 249 // snapshot otherwise it is initialized to NULL. | 249 // snapshot otherwise it is initialized to NULL. |
| 250 extern const uint8_t* core_isolate_snapshot_buffer; | 250 extern const uint8_t* isolate_snapshot_buffer; |
| 251 } | 251 } |
| 252 | 252 |
| 253 | 253 |
| 254 class TestCaseBase { | 254 class TestCaseBase { |
| 255 public: | 255 public: |
| 256 explicit TestCaseBase(const char* name); | 256 explicit TestCaseBase(const char* name); |
| 257 virtual ~TestCaseBase() {} | 257 virtual ~TestCaseBase() {} |
| 258 | 258 |
| 259 const char* name() const { return name_; } | 259 const char* name() const { return name_; } |
| 260 | 260 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 288 bool finalize = true); | 288 bool finalize = true); |
| 289 static Dart_Handle LoadCoreTestScript(const char* script, | 289 static Dart_Handle LoadCoreTestScript(const char* script, |
| 290 Dart_NativeEntryResolver resolver); | 290 Dart_NativeEntryResolver resolver); |
| 291 static Dart_Handle lib(); | 291 static Dart_Handle lib(); |
| 292 static const char* url() { return USER_TEST_URI; } | 292 static const char* url() { return USER_TEST_URI; } |
| 293 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer, | 293 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer, |
| 294 const char* name = NULL) { | 294 const char* name = NULL) { |
| 295 return CreateIsolate(buffer, name); | 295 return CreateIsolate(buffer, name); |
| 296 } | 296 } |
| 297 static Dart_Isolate CreateTestIsolate(const char* name = NULL) { | 297 static Dart_Isolate CreateTestIsolate(const char* name = NULL) { |
| 298 return CreateIsolate(bin::core_isolate_snapshot_buffer, name); | 298 return CreateIsolate(bin::isolate_snapshot_buffer, name); |
| 299 } | 299 } |
| 300 static Dart_Handle library_handler(Dart_LibraryTag tag, | 300 static Dart_Handle library_handler(Dart_LibraryTag tag, |
| 301 Dart_Handle library, | 301 Dart_Handle library, |
| 302 Dart_Handle url); | 302 Dart_Handle url); |
| 303 static char* BigintToHexValue(Dart_CObject* bigint); | 303 static char* BigintToHexValue(Dart_CObject* bigint); |
| 304 | 304 |
| 305 virtual void Run(); | 305 virtual void Run(); |
| 306 | 306 |
| 307 // Sets |script| to be the source used at next reload. | 307 // Sets |script| to be the source used at next reload. |
| 308 static void SetReloadTestScript(const char* script); | 308 static void SetReloadTestScript(const char* script); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 ~SetFlagScope() { *flag_ = original_value_; } | 608 ~SetFlagScope() { *flag_ = original_value_; } |
| 609 | 609 |
| 610 private: | 610 private: |
| 611 T* flag_; | 611 T* flag_; |
| 612 T original_value_; | 612 T original_value_; |
| 613 }; | 613 }; |
| 614 | 614 |
| 615 } // namespace dart | 615 } // namespace dart |
| 616 | 616 |
| 617 #endif // RUNTIME_VM_UNIT_TEST_H_ | 617 #endif // RUNTIME_VM_UNIT_TEST_H_ |
| OLD | NEW |