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

Unified Diff: content/shell/layout_test_controller_bindings.cc

Issue 10740002: Stub out not yet implemented controller methods, so we don't have to wait for timeouts but fail imm… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 5 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 | « content/shell/layout_test_controller.js ('k') | content/shell/layout_test_controller_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/layout_test_controller_bindings.cc
diff --git a/content/shell/layout_test_controller_bindings.cc b/content/shell/layout_test_controller_bindings.cc
index 20131adc6e2d3763961e9b7c3da6e37811b15da1..bd97e4d535a85ac07af7459b3b1f03548c744d2f 100644
--- a/content/shell/layout_test_controller_bindings.cc
+++ b/content/shell/layout_test_controller_bindings.cc
@@ -82,7 +82,7 @@ v8::Handle<v8::Value> SetShouldStayOnPageAfterHandlingBeforeUnload(
if (!view)
return v8::Undefined();
- if (args.Length() != 1 || args[0]->IsBoolean())
+ if (args.Length() != 1 || !args[0]->IsBoolean())
return v8::Undefined();
view->Send(new ShellViewHostMsg_SetShouldStayOnPageAfterHandlingBeforeUnload(
@@ -99,6 +99,21 @@ v8::Handle<v8::Value> SetWaitUntilDone(const v8::Arguments& args) {
return v8::Undefined();
}
+v8::Handle<v8::Value> NotImplemented(const v8::Arguments& args) {
+ RenderView* view = GetCurrentRenderView();
+ if (!view)
+ return v8::Undefined();
+
+ if (args.Length() != 2 || !args[0]->IsString() || !args[1]->IsString())
+ return v8::Undefined();
+
+ view->Send(new ShellViewHostMsg_NotImplemented(
+ view->GetRoutingID(),
+ *v8::String::AsciiValue(args[0]),
+ *v8::String::AsciiValue(args[1])));
+ return v8::Undefined();
+}
+
} // namespace
LayoutTestControllerBindings::LayoutTestControllerBindings()
@@ -131,6 +146,8 @@ LayoutTestControllerBindings::GetNativeFunction(v8::Handle<v8::String> name) {
}
if (name->Equals(v8::String::New("SetWaitUntilDone")))
return v8::FunctionTemplate::New(SetWaitUntilDone);
+ if (name->Equals(v8::String::New("NotImplemented")))
+ return v8::FunctionTemplate::New(NotImplemented);
NOTREACHED();
return v8::FunctionTemplate::New();
« no previous file with comments | « content/shell/layout_test_controller.js ('k') | content/shell/layout_test_controller_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698