Index: runtime/observatory/tests/service/test_helper.dart |
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart |
index f47f1cd45e9bfbf3778be5e9a793482a222146cf..122c9cd3f82cb1cc47e578d9fe60c2b21f92bac9 100644 |
--- a/runtime/observatory/tests/service/test_helper.dart |
+++ b/runtime/observatory/tests/service/test_helper.dart |
@@ -196,6 +196,18 @@ Future<Isolate> resumeIsolate(Isolate isolate) { |
} |
+Future<Class> getClassFromRootLib(Isolate isolate, String className) async { |
+ Library rootLib = await isolate.rootLibrary.load(); |
+ for (var i = 0; i < rootLib.classes.length; i++) { |
+ Class cls = rootLib.classes[i]; |
+ if (cls.name == className) { |
+ return cls; |
+ } |
+ } |
+ return null; |
+} |
+ |
+ |
/// Runs [tests] in sequence, each of which should take an [Isolate] and |
/// return a [Future]. Code for setting up state can run before and/or |
/// concurrently with the tests. Uses [mainArgs] to determine whether |