Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: runtime/vm/unit_test.h

Issue 1965823002: Initial isolate reload support (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« runtime/vm/object.cc ('K') | « runtime/vm/thread.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698