diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 03:31:04 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 03:31:04 +0000 |
commit | 37dacfae5e70134813abc97e59e6f4d44e70fff1 (patch) | |
tree | 517a4c81b0bd551378e09de0afcf6588fe1f1d9d /gin/test | |
parent | a60f20e58d6287ef8e54d474110dd31d64053f1b (diff) | |
download | chromium_src-37dacfae5e70134813abc97e59e6f4d44e70fff1.zip chromium_src-37dacfae5e70134813abc97e59e6f4d44e70fff1.tar.gz chromium_src-37dacfae5e70134813abc97e59e6f4d44e70fff1.tar.bz2 |
Use pump to generate more overloads of CreateFunctionTemplate.
Review URL: https://codereview.chromium.org/86453002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237241 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin/test')
-rw-r--r-- | gin/test/gtest.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gin/test/gtest.cc b/gin/test/gtest.cc index 254c735..eafff4d 100644 --- a/gin/test/gtest.cc +++ b/gin/test/gtest.cc @@ -36,14 +36,10 @@ void ExpectFalse(bool condition, const std::string& description) { EXPECT_FALSE(condition) << description; } -void ExpectEqual(const v8::FunctionCallbackInfo<v8::Value>& info) { - Arguments args(info); - - std::string description; - if (!ConvertFromV8(info[2], &description)) - return args.ThrowTypeError("Expected description."); - - EXPECT_TRUE(info[0]->StrictEquals(info[1])) << description; +void ExpectEqual(const v8::Handle<v8::Value> expected, + const v8::Handle<v8::Value> actual, + const std::string& description) { + EXPECT_TRUE(expected->StrictEquals(actual)) << description; } WrapperInfo g_wrapper_info = { kEmbedderNativeGin }; @@ -65,7 +61,7 @@ v8::Local<v8::ObjectTemplate> GTest::GetTemplate(v8::Isolate* isolate) { templ->Set(StringToSymbol(isolate, "expectFalse"), CreateFunctionTempate(isolate, base::Bind(ExpectFalse))); templ->Set(StringToSymbol(isolate, "expectEqual"), - v8::FunctionTemplate::New(ExpectEqual)); + CreateFunctionTempate(isolate, base::Bind(ExpectEqual))); data->SetObjectTemplate(&g_wrapper_info, templ); } return templ; |