[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
jorlow at chromium.org
jorlow at chromium.org
Wed Dec 22 11:44:32 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2ce2ad8d3f1ddcba2c2836e4443ca232d0fbe969
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 5 14:40:50 2010 +0000
2010-08-05 Satish Sampath <satish at chromium.org>
Reviewed by Jeremy Orlow.
Add speech input controller mock in WebKit and a layout test.
https://bugs.webkit.org/show_bug.cgi?id=43477
* fast/speech/input-text-speechbutton-expected.txt: Added.
* fast/speech/input-text-speechbutton.html: Added.
* fast/speech/script-tests/input-text-speechbutton.js: Added.
(onChange):
(run):
2010-08-05 Satish Sampath <satish at chromium.org>
Reviewed by Jeremy Orlow.
Add speech input controller mock in WebKit and a layout test.
https://bugs.webkit.org/show_bug.cgi?id=43477
* WebKit.gyp:
* public/WebSpeechInputControllerMock.h: Added WebKit speech input controller mock interface.
* src/WebSpeechInputControllerMockImpl.cpp: Added implementation of the above mock.
(WebKit::WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl):
(WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
(WebKit::WebSpeechInputControllerMockImpl::didCompleteRecording):
(WebKit::WebSpeechInputControllerMockImpl::didCompleteRecognition):
(WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult):
(WebKit::WebSpeechInputControllerMockImpl::startRecognition):
(WebKit::WebSpeechInputControllerMockImpl::cancelRecognition):
(WebKit::WebSpeechInputControllerMockImpl::stopRecording):
(WebKit::WebSpeechInputControllerMock::create):
2010-08-05 Satish Sampath <satish at chromium.org>
Reviewed by Jeremy Orlow.
Add speech input controller mock in WebKit and a layout test.
https://bugs.webkit.org/show_bug.cgi?id=43477
Added LayoutTestController::setMockSpeechInputResultCallback method.
* DumpRenderTree/LayoutTestController.cpp:
(setMockSpeechInputResultCallback): Wrapper invoking the member function.
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::setMockSpeechInputResult): Sets the mock result.
(LayoutTestController::speechInputController): Creates the mock controller.
* DumpRenderTree/chromium/LayoutTestController.h:
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::speechInputController): Creates the mock controller.
* DumpRenderTree/chromium/WebViewHost.h:
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::setMockSpeechInputResult): dummy method.
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::setMockSpeechInputResult): dummy method.
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::setMockSpeechInputResult): dummy method.
* DumpRenderTree/qt/LayoutTestControllerQt.h:
* DumpRenderTree/win/LayoutTestControllerWin.cpp: dummy method.
(LayoutTestController::setMockSpeechInputResult):
* DumpRenderTree/wx/LayoutTestControllerWx.cpp: dummy method.
(LayoutTestController::setMockSpeechInputResult):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index fc164f1..6be540f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-05 Satish Sampath <satish at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Add speech input controller mock in WebKit and a layout test.
+ https://bugs.webkit.org/show_bug.cgi?id=43477
+
+ * fast/speech/input-text-speechbutton-expected.txt: Added.
+ * fast/speech/input-text-speechbutton.html: Added.
+ * fast/speech/script-tests/input-text-speechbutton.js: Added.
+ (onChange):
+ (run):
+
2010-08-05 Yury Semikhatsky <yurys at chromium.org>
Unreviewed. Skip new debugger test on Qt.
diff --git a/LayoutTests/fast/speech/input-text-speechbutton-expected.txt b/LayoutTests/fast/speech/input-text-speechbutton-expected.txt
new file mode 100644
index 0000000..715452c
--- /dev/null
+++ b/LayoutTests/fast/speech/input-text-speechbutton-expected.txt
@@ -0,0 +1,9 @@
+Tests for speech button click with <input type="text" speech>.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS input.value is "Pictures of the moon"
+PASS successfullyParsed is true
+
+TEST COMPLETE
\ No newline at end of file
diff --git a/LayoutTests/fast/speech/input-text-speechbutton.html b/LayoutTests/fast/speech/input-text-speechbutton.html
new file mode 100644
index 0000000..51ef00b
--- /dev/null
+++ b/LayoutTests/fast/speech/input-text-speechbutton.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/input-text-speechbutton.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/speech/script-tests/input-text-speechbutton.js b/LayoutTests/fast/speech/script-tests/input-text-speechbutton.js
new file mode 100644
index 0000000..c6512bc
--- /dev/null
+++ b/LayoutTests/fast/speech/script-tests/input-text-speechbutton.js
@@ -0,0 +1,30 @@
+description('Tests for speech button click with <input type="text" speech>.');
+
+function onChange() {
+ shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
+ finishJSTest();
+}
+
+function run() {
+ var input = document.createElement('input');
+ input.id = 'speechInput';
+ input.speech = 'speech';
+ input.addEventListener('change', onChange, false);
+ document.body.appendChild(input);
+
+ if (window.layoutTestController)
+ layoutTestController.setMockSpeechInputResult('Pictures of the moon');
+
+ // Clicking the speech button should fill in mock speech-recognized text.
+ if (window.eventSender) {
+ var x = input.offsetLeft + input.offsetWidth - 4;
+ var y = input.offsetTop + input.offsetHeight / 2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+}
+
+window.onload = run;
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 21a6315..2feb081 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,23 @@
+2010-08-05 Satish Sampath <satish at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Add speech input controller mock in WebKit and a layout test.
+ https://bugs.webkit.org/show_bug.cgi?id=43477
+
+ * WebKit.gyp:
+ * public/WebSpeechInputControllerMock.h: Added WebKit speech input controller mock interface.
+ * src/WebSpeechInputControllerMockImpl.cpp: Added implementation of the above mock.
+ (WebKit::WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl):
+ (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
+ (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecording):
+ (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecognition):
+ (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult):
+ (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+ (WebKit::WebSpeechInputControllerMockImpl::cancelRecognition):
+ (WebKit::WebSpeechInputControllerMockImpl::stopRecording):
+ (WebKit::WebSpeechInputControllerMock::create):
+
2010-08-05 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 9da85cd..d6af3ff 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -240,6 +240,7 @@
'public/WebSocketStreamHandle.h',
'public/WebSocketStreamHandleClient.h',
'public/WebSpeechInputController.h',
+ 'public/WebSpeechInputControllerMock.h',
'public/WebSpeechInputListener.h',
'public/WebStorageArea.h',
'public/WebStorageEventDispatcher.h',
@@ -463,6 +464,8 @@
'src/WebSettingsImpl.h',
'src/WebSharedWorkerImpl.cpp',
'src/WebSharedWorkerImpl.h',
+ 'src/WebSpeechInputControllerMockImpl.cpp',
+ 'src/WebSpeechInputControllerMockImpl.h',
'src/WebStorageAreaImpl.cpp',
'src/WebStorageAreaImpl.h',
'src/WebStorageEventDispatcherImpl.cpp',
diff --git a/WebKit/chromium/public/WebSpeechInputControllerMock.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h
new file mode 100644
index 0000000..6c058e9
--- /dev/null
+++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebSpeechInputControllerMock_h
+#define WebSpeechInputControllerMock_h
+
+#include "WebSpeechInputController.h"
+
+namespace WebKit {
+
+class WebString;
+class WebSpeechInputListener;
+
+class WebSpeechInputControllerMock : public WebSpeechInputController {
+public:
+ static WebSpeechInputControllerMock* create(WebSpeechInputListener* listener);
+ virtual ~WebSpeechInputControllerMock() { }
+
+ virtual void setMockRecognitionResult(const WebString& result) = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
new file mode 100644
index 0000000..a782023
--- /dev/null
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebSpeechInputControllerMockImpl.h"
+
+#include "PlatformString.h"
+#include "SpeechInputClientMock.h"
+
+namespace WebKit {
+
+WebSpeechInputControllerMock* WebSpeechInputControllerMock::create(WebSpeechInputListener* listener)
+{
+ return new WebSpeechInputControllerMockImpl(listener);
+}
+
+WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl(
+ WebSpeechInputListener* listener)
+ : m_webcoreMock(new WebCore::SpeechInputClientMock())
+ , m_listener(listener)
+{
+}
+
+void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result)
+{
+ m_webcoreMock->setRecognitionResult(result);
+}
+
+void WebSpeechInputControllerMockImpl::didCompleteRecording()
+{
+ m_listener->didCompleteRecording();
+}
+
+void WebSpeechInputControllerMockImpl::didCompleteRecognition()
+{
+ m_listener->didCompleteRecognition();
+}
+
+void WebSpeechInputControllerMockImpl::setRecognitionResult(const WebCore::String& result)
+{
+ m_listener->setRecognitionResult(result);
+}
+
+bool WebSpeechInputControllerMockImpl::startRecognition()
+{
+ return m_webcoreMock->startRecognition(this);
+}
+
+void WebSpeechInputControllerMockImpl::cancelRecognition()
+{
+ m_webcoreMock->cancelRecognition();
+}
+
+void WebSpeechInputControllerMockImpl::stopRecording()
+{
+ m_webcoreMock->stopRecording();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
new file mode 100644
index 0000000..5ef5109
--- /dev/null
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebSpeechInputControllerMockImpl_h
+#define WebSpeechInputControllerMockImpl_h
+
+#include "SpeechInputListener.h"
+#include "WebSpeechInputControllerMock.h"
+#include "WebSpeechInputListener.h"
+#include "WebString.h"
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+class SpeechInputClientMock;
+}
+
+namespace WebKit {
+
+class WebSpeechInputControllerMockImpl : public WebCore::SpeechInputListener
+ , public WebSpeechInputControllerMock {
+public:
+ WebSpeechInputControllerMockImpl(WebSpeechInputListener*);
+
+ // WebCore::SpeechInputListener methods.
+ void didCompleteRecording();
+ void didCompleteRecognition();
+ void setRecognitionResult(const WebCore::String& result);
+
+ // WebSpeechInputController methods.
+ bool startRecognition();
+ void cancelRecognition();
+ void stopRecording();
+
+ // WebSpeechInputControllerMock methods.
+ void setMockRecognitionResult(const WebString& result);
+
+private:
+ OwnPtr<WebCore::SpeechInputClientMock> m_webcoreMock;
+ WebSpeechInputListener* m_listener;
+};
+
+} // namespace WebKit
+
+#endif // WebSpeechInputControllerMockImpl_h
+
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 8897dc9..16eddfb 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,36 @@
+2010-08-05 Satish Sampath <satish at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Add speech input controller mock in WebKit and a layout test.
+ https://bugs.webkit.org/show_bug.cgi?id=43477
+
+ Added LayoutTestController::setMockSpeechInputResultCallback method.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback): Wrapper invoking the member function.
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::setMockSpeechInputResult): Sets the mock result.
+ (LayoutTestController::speechInputController): Creates the mock controller.
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::speechInputController): Creates the mock controller.
+ * DumpRenderTree/chromium/WebViewHost.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult): dummy method.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult): dummy method.
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult): dummy method.
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp: dummy method.
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp: dummy method.
+ (LayoutTestController::setMockSpeechInputResult):
+
2010-08-04 Adam Roben <aroben at apple.com>
Fix the path to TestNetscapePlugin's directory on Windows
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 27e4c90..52b539c 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -1050,6 +1050,20 @@ static JSValueRef setMockGeolocationErrorCallback(JSContextRef context, JSObject
return JSValueMakeUndefined(context);
}
+static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> result(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setMockSpeechInputResult(result.get());
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setNewWindowsCopyBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac implementation
@@ -1882,6 +1896,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "setMockDeviceOrientation", setMockDeviceOrientationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setMockGeolocationError", setMockGeolocationErrorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setMockGeolocationPosition", setMockGeolocationPositionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setMockSpeechInputResult", setMockSpeechInputResultCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setNewWindowsCopyBackForwardList", setNewWindowsCopyBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setPersistentUserStyleSheetLocation", setPersistentUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 811d0cb..f76870b 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -93,6 +93,7 @@ public:
void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
void setMockGeolocationError(int code, JSStringRef message);
void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
+ void setMockSpeechInputResult(JSStringRef result);
void setPersistentUserStyleSheetLocation(JSStringRef path);
void setPluginsEnabled(bool flag);
void setPopupBlockingEnabled(bool flag);
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index dd076ae..ac76516 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -47,6 +47,7 @@
#include "public/WebSecurityPolicy.h"
#include "public/WebSettings.h"
#include "public/WebSize.h"
+#include "public/WebSpeechInputControllerMock.h"
#include "public/WebURL.h"
#include "public/WebView.h"
#include "webkit/support/webkit_support.h"
@@ -174,6 +175,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
bindMethod("abortModal", &LayoutTestController::abortModal);
+ bindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);
// The fallback method is called when an unknown method is invoked.
bindFallbackMethod(&LayoutTestController::fallbackMethod);
@@ -1369,3 +1371,19 @@ void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVaria
{
result->setNull();
}
+
+void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 1 || !arguments[0].isString())
+ return;
+
+ m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]));
+}
+
+WebKit::WebSpeechInputController* LayoutTestController::speechInputController(WebKit::WebSpeechInputListener* listener)
+{
+ if (!m_speechInputControllerMock.get())
+ m_speechInputControllerMock.set(WebSpeechInputControllerMock::create(listener));
+ return m_speechInputControllerMock.get();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index 096d1df..fb91544 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -46,6 +46,13 @@
#include "public/WebString.h"
#include "public/WebURL.h"
#include <wtf/Deque.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebKit {
+class WebSpeechInputController;
+class WebSpeechInputControllerMock;
+class WebSpeechInputListener;
+}
class TestShell;
@@ -298,10 +305,14 @@ public:
// Empty stub method to keep parity with object model exposed by global LayoutTestController.
void abortModal(const CppArgumentList&, CppVariant*);
+ // Speech input related functions.
+ void setMockSpeechInputResult(const CppArgumentList&, CppVariant*);
+
public:
// The following methods are not exposed to JavaScript.
void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
+ WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
bool shouldDumpAsText() { return m_dumpAsText; }
bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
@@ -472,6 +483,8 @@ private:
CppVariant m_webHistoryItemCount;
WebKit::WebURL m_userStyleSheetLocation;
+
+ OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
};
#endif // LayoutTestController_h
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
index 1b52699..3ee703e 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
@@ -46,6 +46,7 @@
#include "public/WebScriptController.h"
#include "public/WebSettings.h"
#include "public/WebSize.h"
+#include "public/WebSpeechInputControllerMock.h"
#include "public/WebString.h"
#include "public/WebURLRequest.h"
#include "public/WebURLResponse.h"
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index b761150..a145bf9 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -501,6 +501,11 @@ WebKit::WebGeolocationService* WebViewHost::geolocationService()
return m_geolocationServiceMock.get();
}
+WebSpeechInputController* WebViewHost::speechInputController(WebKit::WebSpeechInputListener* listener)
+{
+ return m_shell->layoutTestController()->speechInputController(listener);
+}
+
// WebWidgetClient -----------------------------------------------------------
void WebViewHost::didInvalidateRect(const WebRect& rect)
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
index 1e51be7..c175e61 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -46,6 +46,8 @@ class TestShell;
namespace WebKit {
class WebFrame;
class WebGeolocationServiceMock;
+class WebSpeechInputController;
+class WebSpeechInputListener;
class WebURL;
struct WebRect;
struct WebURLError;
@@ -126,6 +128,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
virtual void focusAccessibilityObject(const WebKit::WebAccessibilityObject&);
virtual WebKit::WebNotificationPresenter* notificationPresenter();
virtual WebKit::WebGeolocationService* geolocationService();
+ virtual WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
// WebKit::WebWidgetClient
virtual void didInvalidateRect(const WebKit::WebRect&);
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 227e1cc..b0c1cba 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -468,6 +468,12 @@ void LayoutTestController::setGeolocationPermission(bool allow)
setGeolocationPermissionCommon(allow);
}
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
void LayoutTestController::setIconDatabaseEnabled(bool flag)
{
// FIXME: implement
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 66ada91..c0eb722 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -362,6 +362,12 @@ void LayoutTestController::setGeolocationPermission(bool allow)
[[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission];
}
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
{
// FIXME: Workaround <rdar://problem/6480108>
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index 19c4142..e682fd0 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -715,6 +715,12 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo
DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy);
}
+void LayoutTestController::setMockSpeechInputResult(const QString& result)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
void LayoutTestController::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
{
DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(m_drt->webPage()->mainFrame(), worldID, script);
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index 24c0d4b..f9986b1 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -208,6 +208,8 @@ public slots:
bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; }
bool geolocationPermission() const { return m_geolocationPermission; }
+ void setMockSpeechInputResult(const QString& result);
+
// Empty stub method to keep parity with object model exposed by global LayoutTestController.
void abortModal() {}
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index ade09a7..31bc6ce 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -399,6 +399,12 @@ void LayoutTestController::setGeolocationPermission(bool allow)
setGeolocationPermissionCommon(allow);
}
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
{
// See also <rdar://problem/6480108>
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index f969f36..7c80ff2 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -305,6 +305,12 @@ void LayoutTestController::setGeolocationPermission(bool allow)
setGeolocationPermissionCommon(allow);
}
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
{
// FIXME: implement
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list