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

Unified Diff: gin/test/v8_test.cc

Issue 76353002: Introduce a Gin class instead of using global functions to control gin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 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
Index: gin/test/v8_test.cc
diff --git a/gin/test/v8_test.cc b/gin/test/v8_test.cc
index b2c1d5d5161490481663d5dda128a2107fc8039b..b09930edfab6c43b49b3118be42f677bb71b033e 100644
--- a/gin/test/v8_test.cc
+++ b/gin/test/v8_test.cc
@@ -4,10 +4,11 @@
#include "gin/test/v8_test.h"
+#include "gin/gin.h"
+
using v8::Context;
using v8::Local;
using v8::HandleScope;
-using v8::Isolate;
namespace gin {
@@ -18,16 +19,21 @@ V8Test::~V8Test() {
}
void V8Test::SetUp() {
- isolate_ = Isolate::GetCurrent();
- HandleScope handle_scope(isolate_);
- context_.Reset(isolate_, Context::New(isolate_));
- Local<Context>::New(isolate_, context_)->Enter();
+ instance_.reset(new gin::Gin);
+ instance_->isolate()->Enter();
+ HandleScope handle_scope(instance_->isolate());
+ context_.Reset(instance_->isolate(), Context::New(instance_->isolate()));
+ Local<Context>::New(instance_->isolate(), context_)->Enter();
}
void V8Test::TearDown() {
- HandleScope handle_scope(isolate_);
- Local<Context>::New(isolate_, context_)->Exit();
- context_.Reset();
+ {
+ HandleScope handle_scope(instance_->isolate());
+ Local<Context>::New(instance_->isolate(), context_)->Exit();
+ context_.Reset();
+ }
+ instance_->isolate()->Exit();
+ instance_.reset();
}
} // namespace gin
« gin/test/file_runner.cc ('K') | « gin/test/v8_test.h ('k') | mojo/apps/js/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698