Index: runtime/vm/unit_test.h |
diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h |
index a8224c58c15bb4c51492513d343ef2a1572715d7..ac7645a8ec9ae9754d7c88658e27c59edb85ac90 100644 |
--- a/runtime/vm/unit_test.h |
+++ b/runtime/vm/unit_test.h |
@@ -286,7 +286,6 @@ class TestCase : TestCaseBase { |
Dart_NativeEntryResolver resolver, |
const char* lib_uri = USER_TEST_URI, |
bool finalize = true); |
- |
static Dart_Handle LoadCoreTestScript(const char* script, |
Dart_NativeEntryResolver resolver); |
static Dart_Handle lib(); |
@@ -305,6 +304,16 @@ class TestCase : TestCaseBase { |
virtual void Run(); |
+ // Sets |script| to be the source used at next reload. |
+ static void SetReloadTestScript(const char* script); |
+ // Initiates the reload. |
+ static Dart_Handle TriggerReload(); |
+ // Gets the result of a reload. |
+ static Dart_Handle GetReloadErrorOrRootLibrary(); |
+ |
+ // Helper function which reloads the current isolate using |script|. |
+ static Dart_Handle ReloadTestScript(const char* script); |
+ |
private: |
static Dart_Isolate CreateIsolate(const uint8_t* buffer, const char* name); |
@@ -586,6 +595,24 @@ class CompilerTest : public AllStatic { |
void ElideJSONSubstring(const char* prefix, const char* in, char* out); |
+template<typename T> |
+class SetFlagScope : public ValueObject { |
+ public: |
+ SetFlagScope(T* flag, T value) |
+ : flag_(flag), |
+ original_value_(*flag) { |
+ *flag_ = value; |
+ } |
+ |
+ ~SetFlagScope() { |
+ *flag_ = original_value_; |
+ } |
+ |
+ private: |
+ T* flag_; |
+ T original_value_; |
+}; |
+ |
} // namespace dart |
#endif // VM_UNIT_TEST_H_ |