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

Unified Diff: gin/converter_unittest.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: 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
« no previous file with comments | « no previous file | gin/gin.h » ('j') | gin/gin.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/converter_unittest.cc
diff --git a/gin/converter_unittest.cc b/gin/converter_unittest.cc
index b98a6dae33d38d0b288d5d8ffa99b88b0a95c2b7..ade9dff83a18129bdc7820fe9454553b4af61265 100644
--- a/gin/converter_unittest.cc
+++ b/gin/converter_unittest.cc
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "gin/gin.h"
#include "gin/test/v8_test.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "v8/include/v8.h"
@@ -30,11 +31,11 @@ namespace gin {
typedef V8Test ConverterTest;
TEST_F(ConverterTest, Bool) {
- HandleScope handle_scope(isolate_);
+ HandleScope handle_scope(instance_->isolate());
- EXPECT_TRUE(Converter<bool>::ToV8(isolate_, true)->StrictEquals(
+ EXPECT_TRUE(Converter<bool>::ToV8(instance_->isolate(), true)->StrictEquals(
Boolean::New(true)));
- EXPECT_TRUE(Converter<bool>::ToV8(isolate_, false)->StrictEquals(
+ EXPECT_TRUE(Converter<bool>::ToV8(instance_->isolate(), false)->StrictEquals(
Boolean::New(false)));
struct {
@@ -66,11 +67,11 @@ TEST_F(ConverterTest, Bool) {
}
TEST_F(ConverterTest, Int32) {
- HandleScope handle_scope(isolate_);
+ HandleScope handle_scope(instance_->isolate());
int test_data_to[] = {-1, 0, 1};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data_to); ++i) {
- EXPECT_TRUE(Converter<int32_t>::ToV8(isolate_,
+ EXPECT_TRUE(Converter<int32_t>::ToV8(instance_->isolate(),
test_data_to[i])->StrictEquals(Integer::New(test_data_to[i])));
}
@@ -104,7 +105,7 @@ TEST_F(ConverterTest, Int32) {
}
TEST_F(ConverterTest, Vector) {
- HandleScope handle_scope(isolate_);
+ HandleScope handle_scope(instance_->isolate());
std::vector<int> expected;
expected.push_back(-1);
@@ -112,7 +113,7 @@ TEST_F(ConverterTest, Vector) {
expected.push_back(1);
Handle<Array> js_array = Handle<Array>::Cast(
- Converter<std::vector<int> >::ToV8(isolate_, expected));
+ Converter<std::vector<int> >::ToV8(instance_->isolate(), expected));
ASSERT_FALSE(js_array.IsEmpty());
EXPECT_EQ(3u, js_array->Length());
for (size_t i = 0; i < expected.size(); ++i) {
« no previous file with comments | « no previous file | gin/gin.h » ('j') | gin/gin.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698