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

Unified Diff: gin/wrappable_unittest.cc

Issue 671433004: [gin] Use variadic templates in gin/function_template.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing exception throwing. Created 6 years, 2 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
« gin/function_template.h ('K') | « gin/function_template.h.pump ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/wrappable_unittest.cc
diff --git a/gin/wrappable_unittest.cc b/gin/wrappable_unittest.cc
index 0e10c326b5ca438dc725d3e1edb343a7f0ad9141..3ee50576e91afbb061c306029f4303f7f18d4897 100644
--- a/gin/wrappable_unittest.cc
+++ b/gin/wrappable_unittest.cc
@@ -97,11 +97,11 @@ class MyCallableObject : public Wrappable<MyCallableObject> {
virtual ~MyCallableObject() {
}
- void Call(int val, const gin::Arguments& arguments) {
+ void Call(int val1, int val2, int val3, const gin::Arguments& arguments) {
if (arguments.IsConstructCall())
arguments.ThrowTypeError("Cannot be called as constructor.");
else
- result_ = val;
+ result_ = val1;
}
int result_;
@@ -233,7 +233,7 @@ TEST_F(WrappableTest, CallAsFunction) {
EXPECT_EQ(0, object->result());
v8::Handle<v8::String> source = StringToV8(isolate,
"(function(obj) {"
- "obj(42);"
+ "obj(42, 2, 5);"
"})");
gin::TryCatch try_catch;
v8::Handle<v8::Script> script = v8::Script::Compile(source);
@@ -256,7 +256,7 @@ TEST_F(WrappableTest, CallAsConstructor) {
EXPECT_EQ(0, object->result());
v8::Handle<v8::String> source = StringToV8(isolate,
"(function(obj) {"
- "new obj(42);"
+ "new obj(42, 2, 5);"
"})");
gin::TryCatch try_catch;
v8::Handle<v8::Script> script = v8::Script::Compile(source);
« gin/function_template.h ('K') | « gin/function_template.h.pump ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698