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

Unified Diff: runtime/vm/snapshot_test.cc

Issue 2584943002: Remove Dart_CreateLibrarySnapshot. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot_test.cc
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index 81c43420b34ac547827610b350e5cffa14be0cb2..79b5b1b907a8b9599fcaff1b479a69652c923969 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -1399,47 +1399,6 @@ UNIT_TEST_CASE(ScriptSnapshot) {
Dart_ExitScope();
Dart_ShutdownIsolate();
}
- free(script_snapshot);
-
- // Test for Dart_CreateLibrarySnapshot.
- {
- // Create an Isolate using the full snapshot, load a script and create
- // a script snapshot of the script.
- TestCase::CreateTestIsolateFromSnapshot(full_snapshot);
- Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
-
- // Load the library.
- Dart_Handle lib = Dart_LoadLibrary(NewString("dart_lib"), Dart_Null(),
- NewString(kScriptChars), 0, 0);
- EXPECT_VALID(lib);
-
- // Write out the script snapshot.
- result = Dart_CreateLibrarySnapshot(lib, &buffer, &size);
- EXPECT_VALID(result);
- script_snapshot = reinterpret_cast<uint8_t*>(malloc(size));
- memmove(script_snapshot, buffer, size);
- Dart_ExitScope();
- Dart_ShutdownIsolate();
- }
-
- {
- // Now Create an Isolate using the full snapshot and load the
- // script snapshot created above and execute it.
- TestCase::CreateTestIsolateFromSnapshot(full_snapshot);
- Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
-
- // Load the test library from the snapshot.
- EXPECT(script_snapshot != NULL);
- result = Dart_LoadScriptFromSnapshot(script_snapshot, size);
- EXPECT_VALID(result);
-
- // Invoke a function which returns an object.
- Dart_Handle cls = Dart_GetClass(result, NewString("FieldsTest"));
- result = Dart_Invoke(cls, NewString("testMain"), 0, NULL);
- EXPECT_VALID(result);
- Dart_ExitScope();
- Dart_ShutdownIsolate();
- }
free(full_snapshot);
free(script_snapshot);
}
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698