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

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

Issue 394007: * Remove old snapshot implementation (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') | « test/cctest/cctest.status ('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 3302)
+++ test/cctest/test-serialize.cc (working copy)
@@ -174,83 +174,32 @@
static void Serialize() {
-#ifdef DEBUG
Christian Plesner Hansen 2009/11/13 13:43:36 We have corresponding tests for the new serializer
- FLAG_debug_serialization = true;
-#endif
- StatsTable::SetCounterFunction(counter_function);
-
- v8::HandleScope scope;
- const int kExtensionCount = 1;
- const char* extension_list[kExtensionCount] = { "v8/gc" };
- v8::ExtensionConfiguration extensions(kExtensionCount, extension_list);
- Serializer::Enable();
- v8::Persistent<v8::Context> env = v8::Context::New(&extensions);
- env->Enter();
-
- Snapshot::WriteToFile(FLAG_testing_serialization_file);
-}
-
-
-static void Serialize2() {
// We have to create one context. One reason for this is so that the builtins
// can be loaded from v8natives.js and their addresses can be processed. This
// will clear the pending fixups array, which would otherwise contain GC roots
// that would confuse the serialization/deserialization process.
v8::Persistent<v8::Context> env = v8::Context::New();
env.Dispose();
- Snapshot::WriteToFile2(FLAG_testing_serialization_file);
+ Snapshot::WriteToFile(FLAG_testing_serialization_file);
}
-// Test that the whole heap can be serialized when running from a
-// bootstrapped heap.
-// (Smoke test.)
-TEST(Serialize) {
- if (Snapshot::IsEnabled()) return;
- Serialize();
-}
-
-
// Test that the whole heap can be serialized.
-TEST(Serialize2) {
+TEST(Serialize) {
Serializer::Enable();
v8::V8::Initialize();
- Serialize2();
+ Serialize();
}
-// Test that the heap isn't destroyed after a serialization.
-TEST(SerializeNondestructive) {
- if (Snapshot::IsEnabled()) return;
- StatsTable::SetCounterFunction(counter_function);
- v8::HandleScope scope;
- Serializer::Enable();
- v8::Persistent<v8::Context> env = v8::Context::New();
- v8::Context::Scope context_scope(env);
- Serializer().Serialize();
- const char* c_source = "\"abcd\".charAt(2) == 'c'";
- v8::Local<v8::String> source = v8::String::New(c_source);
- v8::Local<v8::Script> script = v8::Script::Compile(source);
- v8::Local<v8::Value> value = script->Run();
- CHECK(value->BooleanValue());
-}
-
//----------------------------------------------------------------------------
// Tests that the heap can be deserialized.
static void Deserialize() {
-#ifdef DEBUG
- FLAG_debug_serialization = true;
-#endif
CHECK(Snapshot::Initialize(FLAG_testing_serialization_file));
}
-static void Deserialize2() {
- CHECK(Snapshot::Initialize2(FLAG_testing_serialization_file));
-}
-
-
static void SanityCheck() {
v8::HandleScope scope;
#ifdef DEBUG
@@ -269,15 +218,6 @@
Deserialize();
- SanityCheck();
-}
-
-
-DEPENDENT_TEST(Deserialize2, Serialize2) {
- v8::HandleScope scope;
-
- Deserialize2();
-
fflush(stdout);
v8::Persistent<v8::Context> env = v8::Context::New();
@@ -287,23 +227,11 @@
}
-DEPENDENT_TEST(DeserializeAndRunScript, Serialize) {
+DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) {
v8::HandleScope scope;
Deserialize();
- 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());
-}
-
-
-DEPENDENT_TEST(DeserializeAndRunScript2, Serialize2) {
- v8::HandleScope scope;
-
- Deserialize2();
-
v8::Persistent<v8::Context> env = v8::Context::New();
env->Enter();
@@ -314,31 +242,6 @@
}
-DEPENDENT_TEST(DeserializeNatives, Serialize) {
- v8::HandleScope scope;
-
- Deserialize();
-
- const char* c_source = "\"abcd\".charAt(2) == 'c'";
- v8::Local<v8::String> source = v8::String::New(c_source);
- v8::Local<v8::Script> script = v8::Script::Compile(source);
- v8::Local<v8::Value> value = script->Run();
- CHECK(value->BooleanValue());
-}
-
-
-DEPENDENT_TEST(DeserializeExtensions, Serialize) {
- v8::HandleScope scope;
-
- Deserialize();
- const char* c_source = "gc();";
- v8::Local<v8::String> source = v8::String::New(c_source);
- v8::Local<v8::Script> script = v8::Script::Compile(source);
- v8::Local<v8::Value> value = script->Run();
- CHECK(value->IsUndefined());
-}
-
-
TEST(TestThatAlwaysSucceeds) {
}
« src/serialize.cc ('K') | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698