diff options
Diffstat (limited to 'webkit/tools/test_shell/layout_test_controller.cc')
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 9878bf6..cad5bb5 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" @@ -204,6 +205,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); @@ -1123,6 +1125,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) { |