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

Unified Diff: chrome/renderer/extensions/activity_log_converter_strategy_unittest.cc

Issue 23636015: Remove unsafe access hacks from ScopedPersistent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: code review (jyasskin)' Created 7 years, 3 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 | « no previous file | chrome/renderer/extensions/chrome_v8_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/activity_log_converter_strategy_unittest.cc
diff --git a/chrome/renderer/extensions/activity_log_converter_strategy_unittest.cc b/chrome/renderer/extensions/activity_log_converter_strategy_unittest.cc
index b113d7a6505baaedaf6031fc73ddca86dc293f40..171cf6904175c5965a1f9eec5d98e81ff04f23f7 100644
--- a/chrome/renderer/extensions/activity_log_converter_strategy_unittest.cc
+++ b/chrome/renderer/extensions/activity_log_converter_strategy_unittest.cc
@@ -19,7 +19,7 @@ class ActivityLogConverterStrategyTest : public testing::Test {
: isolate_(v8::Isolate::GetCurrent())
, handle_scope_(isolate_)
, context_(v8::Context::New(isolate_))
- , context_scope_(context_.get()) {
+ , context_scope_(context()) {
}
protected:
@@ -32,7 +32,7 @@ class ActivityLogConverterStrategyTest : public testing::Test {
testing::AssertionResult VerifyNull(v8::Local<v8::Value> v8_value) {
scoped_ptr<base::Value> value(
- converter_->FromV8Value(v8_value, context_.get()));
+ converter_->FromV8Value(v8_value, context()));
if (value->IsType(base::Value::TYPE_NULL))
return testing::AssertionSuccess();
return testing::AssertionFailure();
@@ -42,7 +42,7 @@ class ActivityLogConverterStrategyTest : public testing::Test {
bool expected) {
bool out;
scoped_ptr<base::Value> value(
- converter_->FromV8Value(v8_value, context_.get()));
+ converter_->FromV8Value(v8_value, context()));
if (value->IsType(base::Value::TYPE_BOOLEAN)
&& value->GetAsBoolean(&out)
&& out == expected)
@@ -54,7 +54,7 @@ class ActivityLogConverterStrategyTest : public testing::Test {
int expected) {
int out;
scoped_ptr<base::Value> value(
- converter_->FromV8Value(v8_value, context_.get()));
+ converter_->FromV8Value(v8_value, context()));
if (value->IsType(base::Value::TYPE_INTEGER)
&& value->GetAsInteger(&out)
&& out == expected)
@@ -66,7 +66,7 @@ class ActivityLogConverterStrategyTest : public testing::Test {
double expected) {
double out;
scoped_ptr<base::Value> value(
- converter_->FromV8Value(v8_value, context_.get()));
+ converter_->FromV8Value(v8_value, context()));
if (value->IsType(base::Value::TYPE_DOUBLE)
&& value->GetAsDouble(&out)
&& out == expected)
@@ -78,7 +78,7 @@ class ActivityLogConverterStrategyTest : public testing::Test {
const std::string& expected) {
std::string out;
scoped_ptr<base::Value> value(
- converter_->FromV8Value(v8_value, context_.get()));
+ converter_->FromV8Value(v8_value, context()));
if (value->IsType(base::Value::TYPE_STRING)
&& value->GetAsString(&out)
&& out == expected)
@@ -86,6 +86,10 @@ class ActivityLogConverterStrategyTest : public testing::Test {
return testing::AssertionFailure();
}
+ v8::Handle<v8::Context> context() const {
+ return context_.NewHandle(isolate_);
+ }
+
v8::Isolate* isolate_;
v8::HandleScope handle_scope_;
ScopedPersistent<v8::Context> context_;
@@ -155,4 +159,3 @@ TEST_F(ActivityLogConverterStrategyTest, ConversionTest) {
}
} // namespace extensions
-
« no previous file with comments | « no previous file | chrome/renderer/extensions/chrome_v8_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698