diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 11:18:15 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 11:18:15 +0000 |
commit | 329cb6e677c375773eb71f0a63f0b2b25149765d (patch) | |
tree | 8d3adf3ff13b9e8685c2b45f172757431317032e /webkit/tools/test_shell/layout_test_controller.cc | |
parent | 0e000bfbdaad9c97d004f49528c2334a730737c6 (diff) | |
download | chromium_src-329cb6e677c375773eb71f0a63f0b2b25149765d.zip chromium_src-329cb6e677c375773eb71f0a63f0b2b25149765d.tar.gz chromium_src-329cb6e677c375773eb71f0a63f0b2b25149765d.tar.bz2 |
Adds speech input mock methods to TestShell.
BUG=53598
TEST=The layout test input-text-speechbutton.html should now pass.
Review URL: http://codereview.chromium.org/3466019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60771 0039d316-1c4b-4281-b951-d872f2087c98
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) { |