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

Unified Diff: webkit/tools/test_shell/layout_test_controller.cc

Issue 3466019: Adds speech input mock methods to TestShell. (Closed)
Patch Set: Created 10 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 | « webkit/tools/test_shell/layout_test_controller.h ('k') | webkit/tools/test_shell/test_shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/layout_test_controller.cc
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index feff62d80bac3135c078fe32171a24da1e6e71ce..b69bdf380a15230c46479a6cab96f68d4e51fd1d 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -32,6 +32,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebSecurityPolicy.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSettings.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputControllerMock.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebView.h"
#include "webkit/glue/dom_operations.h"
@@ -203,6 +204,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) :
BindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
BindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation);
+ BindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);
// The fallback method is called when an unknown method is invoked.
BindFallbackMethod(&LayoutTestController::fallbackMethod);
@@ -1109,6 +1111,15 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(
result->SetNull();
}
+void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& args,
+ CppVariant* result) {
+ if (args.size() > 0 && args[0].isString()) {
+ shell_->speech_input_controller_mock()->setMockRecognitionResult(
+ WebString::fromUTF8(args[0].ToString()));
+ }
+ result->SetNull();
+}
+
// Need these conversions because the format of the value for booleans
// may vary - for example, on mac "1" and "0" are used for boolean.
bool LayoutTestController::CppVariantToBool(const CppVariant& value) {
« no previous file with comments | « webkit/tools/test_shell/layout_test_controller.h ('k') | webkit/tools/test_shell/test_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698