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

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

Issue 15038002: Revert "deprecate Context::New which returns Persistent" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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
« no previous file with comments | « test/cctest/test-regexp.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
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc
index 0cf80440f6dafe823dcbbfcb4bf2dadacb1c39a9..d236cf1fa8a8f927d833ab90107ed49b7a031cc8 100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -251,11 +251,8 @@ static void Serialize() {
// 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::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope scope(isolate);
- v8::Context::New(isolate);
- }
+ v8::Persistent<v8::Context> env = v8::Context::New();
+ env.Dispose(env->GetIsolate());
WriteToFile(FLAG_testing_serialization_file);
}
@@ -307,11 +304,10 @@ DEPENDENT_TEST(Deserialize, Serialize) {
// serialization. That doesn't matter. We don't need to be able to
// serialize a snapshot in a VM that is booted from a snapshot.
if (!Snapshot::HaveASnapshotToStartFrom()) {
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope scope(isolate);
+ v8::HandleScope scope(v8::Isolate::GetCurrent());
Deserialize();
- v8::Local<v8::Context> env = v8::Context::New(isolate);
+ v8::Persistent<v8::Context> env = v8::Context::New();
env->Enter();
SanityCheck();
@@ -321,11 +317,10 @@ DEPENDENT_TEST(Deserialize, Serialize) {
DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) {
if (!Snapshot::HaveASnapshotToStartFrom()) {
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope scope(isolate);
+ v8::HandleScope scope(v8::Isolate::GetCurrent());
Deserialize();
- v8::Local<v8::Context> env = v8::Context::New(isolate);
+ v8::Persistent<v8::Context> env = v8::Context::New();
env->Enter();
SanityCheck();
@@ -335,11 +330,10 @@ DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) {
DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) {
if (!Snapshot::HaveASnapshotToStartFrom()) {
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope scope(isolate);
+ v8::HandleScope scope(v8::Isolate::GetCurrent());
Deserialize();
- v8::Local<v8::Context> env = v8::Context::New(isolate);
+ v8::Persistent<v8::Context> env = v8::Context::New();
env->Enter();
const char* c_source = "\"1234\".length";
@@ -353,11 +347,10 @@ DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) {
DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2,
SerializeTwice) {
if (!Snapshot::HaveASnapshotToStartFrom()) {
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope scope(isolate);
+ v8::HandleScope scope(v8::Isolate::GetCurrent());
Deserialize();
- v8::Local<v8::Context> env = v8::Context::New(isolate);
+ v8::Persistent<v8::Context> env = v8::Context::New();
env->Enter();
const char* c_source = "\"1234\".length";
@@ -375,12 +368,7 @@ TEST(PartialSerialization) {
Isolate* isolate = Isolate::Current();
Heap* heap = isolate->heap();
- v8::Persistent<v8::Context> env;
- {
- HandleScope scope(isolate);
- env.Reset(v8::Isolate::GetCurrent(),
- v8::Context::New(v8::Isolate::GetCurrent()));
- }
+ v8::Persistent<v8::Context> env = v8::Context::New();
ASSERT(!env.IsEmpty());
env->Enter();
// Make sure all builtin scripts are cached.
@@ -514,12 +502,7 @@ TEST(ContextSerialization) {
Isolate* isolate = Isolate::Current();
Heap* heap = isolate->heap();
- v8::Persistent<v8::Context> env;
- {
- HandleScope scope(isolate);
- env.Reset(v8::Isolate::GetCurrent(),
- v8::Context::New(v8::Isolate::GetCurrent()));
- }
+ v8::Persistent<v8::Context> env = v8::Context::New();
ASSERT(!env.IsEmpty());
env->Enter();
// Make sure all builtin scripts are cached.
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698