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

Unified Diff: test/cctest/test-serialize.cc

Issue 441017: Make heap serialization nondestructive. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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
« src/serialize.cc ('K') | « src/serialize.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-serialize.cc
===================================================================
--- test/cctest/test-serialize.cc (revision 3358)
+++ test/cctest/test-serialize.cc (working copy)
@@ -192,6 +192,15 @@
}
+// Test that heap serialization is non-destructive.
+TEST(SerializeTwice) {
+ Serializer::Enable();
+ v8::V8::Initialize();
+ Serialize();
+ Serialize();
+}
+
+
//----------------------------------------------------------------------------
// Tests that the heap can be deserialized.
@@ -218,8 +227,18 @@
Deserialize();
- fflush(stdout);
+ v8::Persistent<v8::Context> env = v8::Context::New();
+ env->Enter();
+ SanityCheck();
+}
+
+
+DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) {
+ v8::HandleScope scope;
+
+ Deserialize();
+
v8::Persistent<v8::Context> env = v8::Context::New();
env->Enter();
@@ -242,6 +261,22 @@
}
+DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2,
+ SerializeTwice) {
+ v8::HandleScope scope;
+
+ Deserialize();
+
+ v8::Persistent<v8::Context> env = v8::Context::New();
+ env->Enter();
+
+ const char* c_source = "\"1234\".length";
+ v8::Local<v8::String> source = v8::String::New(c_source);
+ v8::Local<v8::Script> script = v8::Script::Compile(source);
+ CHECK_EQ(4, script->Run()->Int32Value());
+}
+
+
TEST(TestThatAlwaysSucceeds) {
}
« src/serialize.cc ('K') | « src/serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698