summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/tools/test_shell/layout_test_controller.cc13
-rw-r--r--webkit/tools/test_shell/layout_test_controller.h2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc2
3 files changed, 10 insertions, 7 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index 8816e85..d344dfa 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -207,7 +207,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) :
BindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
BindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation);
- BindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);
+ BindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult);
// The fallback method is called when an unknown method is invoked.
BindFallbackMethod(&LayoutTestController::fallbackMethod);
@@ -1133,12 +1133,13 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(
result->SetNull();
}
-void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& args,
+void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& args,
CppVariant* result) {
- if (args.size() > 0 && args[0].isString() && args[1].isString()) {
- shell_->speech_input_controller_mock()->setMockRecognitionResult(
- WebString::fromUTF8(args[0].ToString()),
- WebString::fromUTF8(args[1].ToString()));
+ if (args.size() > 0 && args[0].isString() && args[1].isNumber() &&
+ args[2].isString()) {
+ shell_->speech_input_controller_mock()->addMockRecognitionResult(
+ WebString::fromUTF8(args[0].ToString()), args[1].ToDouble(),
+ WebString::fromUTF8(args[2].ToString()));
}
result->SetNull();
}
diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h
index bd202cd..9138cc4 100644
--- a/webkit/tools/test_shell/layout_test_controller.h
+++ b/webkit/tools/test_shell/layout_test_controller.h
@@ -233,7 +233,7 @@ class LayoutTestController : public CppBoundClass {
void overridePreference(const CppArgumentList& args, CppVariant* result);
void setAllowUniversalAccessFromFileURLs(const CppArgumentList& args, CppVariant* result);
void setAllowFileAccessFromFileURLs(const CppArgumentList& args, CppVariant* result);
- void setMockSpeechInputResult(const CppArgumentList& args, CppVariant* result);
+ void addMockSpeechInputResult(const CppArgumentList& args, CppVariant* result);
// The fallback method is called when a nonexistent method is called on
// the layout test controller object.
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index f22b6b8..1973acb 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -1175,6 +1175,8 @@ void TestWebViewDelegate::Reset() {
TestShell* shell = shell_;
this->~TestWebViewDelegate();
new (this) TestWebViewDelegate(shell);
+ if (shell->speech_input_controller_mock())
+ shell->speech_input_controller_mock()->clearResults();
}
void TestWebViewDelegate::SetSmartInsertDeleteEnabled(bool enabled) {