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

Unified Diff: runtime/vm/object_test.cc

Issue 346003003: vmservice: Add /coverage collection to scripts, classes and libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: exclude service_classescoverage from simmips tests Created 6 years, 6 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/object_test.cc
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 5cd2749a67fb6b3a45a1e890b4e39928ebf198af..e7b69f62b861ae1060e4bbc57e92d5c133b27cf0 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -2213,6 +2213,22 @@ TEST_CASE(Script) {
EXPECT_EQ('T', str.CharAt(0));
EXPECT_EQ('n', str.CharAt(10));
EXPECT_EQ('.', str.CharAt(21));
+
+ const char* kScript = "main() {}";
+ Dart_Handle h_lib = TestCase::LoadTestScript(kScript, NULL);
+ EXPECT_VALID(h_lib);
+ Library& lib = Library::Handle();
+ lib ^= Api::UnwrapHandle(h_lib);
+ EXPECT(!lib.IsNull());
+ Dart_Handle result = Dart_Invoke(h_lib, NewString("main"), 0, NULL);
+ EXPECT_VALID(result);
+ Script& script2 = Script::Handle(
+ Script::FindByUrl(String::Handle(String::New("test-lib"))));
+ EXPECT(!script2.IsNull());
+ const Library& lib2 = Library::Handle(script2.FindLibrary());
+ EXPECT_EQ(lib2.raw(), lib.raw());
+ script2 = Script::FindByUrl(String::Handle(String::New("non-there.dart")));
+ EXPECT(script2.IsNull());
}

Powered by Google App Engine
This is Rietveld 408576698