Changeset 64749 in webkit


Ignore:
Timestamp:
Aug 5, 2010 7:40:50 AM (14 years ago)
Author:
jorlow@chromium.org
Message:

2010-08-05 Satish Sampath <satish@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@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@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):
Location:
trunk
Files:
7 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64748 r64749  
     12010-08-05  Satish Sampath  <satish@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Add speech input controller mock in WebKit and a layout test.
     6        https://bugs.webkit.org/show_bug.cgi?id=43477
     7
     8        * fast/speech/input-text-speechbutton-expected.txt: Added.
     9        * fast/speech/input-text-speechbutton.html: Added.
     10        * fast/speech/script-tests/input-text-speechbutton.js: Added.
     11        (onChange):
     12        (run):
     13
    1142010-08-05  Yury Semikhatsky  <yurys@chromium.org>
    215
  • trunk/WebKit/chromium/ChangeLog

    r64742 r64749  
     12010-08-05  Satish Sampath  <satish@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Add speech input controller mock in WebKit and a layout test.
     6        https://bugs.webkit.org/show_bug.cgi?id=43477
     7
     8        * WebKit.gyp:
     9        * public/WebSpeechInputControllerMock.h: Added WebKit speech input controller mock interface.
     10        * src/WebSpeechInputControllerMockImpl.cpp: Added implementation of the above mock.
     11        (WebKit::WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl):
     12        (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
     13        (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecording):
     14        (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecognition):
     15        (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult):
     16        (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
     17        (WebKit::WebSpeechInputControllerMockImpl::cancelRecognition):
     18        (WebKit::WebSpeechInputControllerMockImpl::stopRecording):
     19        (WebKit::WebSpeechInputControllerMock::create):
     20
    1212010-08-05  Pavel Feldman  <pfeldman@chromium.org>
    222
  • trunk/WebKit/chromium/WebKit.gyp

    r64534 r64749  
    241241                'public/WebSocketStreamHandleClient.h',
    242242                'public/WebSpeechInputController.h',
     243                'public/WebSpeechInputControllerMock.h',
    243244                'public/WebSpeechInputListener.h',
    244245                'public/WebStorageArea.h',
     
    464465                'src/WebSharedWorkerImpl.cpp',
    465466                'src/WebSharedWorkerImpl.h',
     467                'src/WebSpeechInputControllerMockImpl.cpp',
     468                'src/WebSpeechInputControllerMockImpl.h',
    466469                'src/WebStorageAreaImpl.cpp',
    467470                'src/WebStorageAreaImpl.h',
  • trunk/WebKitTools/ChangeLog

    r64744 r64749  
     12010-08-05  Satish Sampath  <satish@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Add speech input controller mock in WebKit and a layout test.
     6        https://bugs.webkit.org/show_bug.cgi?id=43477
     7
     8        Added LayoutTestController::setMockSpeechInputResultCallback method.
     9
     10        * DumpRenderTree/LayoutTestController.cpp:
     11        (setMockSpeechInputResultCallback): Wrapper invoking the member function.
     12        (LayoutTestController::staticFunctions):
     13        * DumpRenderTree/LayoutTestController.h:
     14        * DumpRenderTree/chromium/LayoutTestController.cpp:
     15        (LayoutTestController::LayoutTestController):
     16        (LayoutTestController::setMockSpeechInputResult): Sets the mock result.
     17        (LayoutTestController::speechInputController): Creates the mock controller.
     18        * DumpRenderTree/chromium/LayoutTestController.h:
     19        * DumpRenderTree/chromium/WebViewHost.cpp:
     20        (WebViewHost::speechInputController): Creates the mock controller.
     21        * DumpRenderTree/chromium/WebViewHost.h:
     22        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
     23        (LayoutTestController::setMockSpeechInputResult): dummy method.
     24        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
     25        (LayoutTestController::setMockSpeechInputResult): dummy method.
     26        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     27        (LayoutTestController::setMockSpeechInputResult): dummy method.
     28        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     29        * DumpRenderTree/win/LayoutTestControllerWin.cpp: dummy method.
     30        (LayoutTestController::setMockSpeechInputResult):
     31        * DumpRenderTree/wx/LayoutTestControllerWx.cpp: dummy method.
     32        (LayoutTestController::setMockSpeechInputResult):
     33
    1342010-08-04  Adam Roben  <aroben@apple.com>
    235
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp

    r64639 r64749  
    10471047    LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
    10481048    controller->setMockGeolocationError(code, message.get());
     1049
     1050    return JSValueMakeUndefined(context);
     1051}
     1052
     1053static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     1054{
     1055    if (argumentCount < 1)
     1056        return JSValueMakeUndefined(context);
     1057
     1058    JSRetainPtr<JSStringRef> result(Adopt, JSValueToStringCopy(context, arguments[0], exception));
     1059    ASSERT(!*exception);
     1060
     1061    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
     1062    controller->setMockSpeechInputResult(result.get());
    10491063
    10501064    return JSValueMakeUndefined(context);
     
    18831897        { "setMockGeolocationError", setMockGeolocationErrorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    18841898        { "setMockGeolocationPosition", setMockGeolocationPositionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     1899        { "setMockSpeechInputResult", setMockSpeechInputResultCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    18851900        { "setNewWindowsCopyBackForwardList", setNewWindowsCopyBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    18861901        { "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.h

    r64639 r64749  
    9494    void setMockGeolocationError(int code, JSStringRef message);
    9595    void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
     96    void setMockSpeechInputResult(JSStringRef result);
    9697    void setPersistentUserStyleSheetLocation(JSStringRef path);
    9798    void setPluginsEnabled(bool flag);
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp

    r64613 r64749  
    4848#include "public/WebSettings.h"
    4949#include "public/WebSize.h"
     50#include "public/WebSpeechInputControllerMock.h"
    5051#include "public/WebURL.h"
    5152#include "public/WebView.h"
     
    175176    bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
    176177    bindMethod("abortModal", &LayoutTestController::abortModal);
     178    bindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);
    177179
    178180    // The fallback method is called when an unknown method is invoked.
     
    13701372    result->setNull();
    13711373}
     1374
     1375void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
     1376{
     1377    result->setNull();
     1378    if (arguments.size() < 1 || !arguments[0].isString())
     1379        return;
     1380
     1381    m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]));
     1382}
     1383
     1384WebKit::WebSpeechInputController* LayoutTestController::speechInputController(WebKit::WebSpeechInputListener* listener)
     1385{
     1386    if (!m_speechInputControllerMock.get())
     1387        m_speechInputControllerMock.set(WebSpeechInputControllerMock::create(listener));
     1388    return m_speechInputControllerMock.get();
     1389}
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h

    r64613 r64749  
    4747#include "public/WebURL.h"
    4848#include <wtf/Deque.h>
     49#include <wtf/OwnPtr.h>
     50
     51namespace WebKit {
     52class WebSpeechInputController;
     53class WebSpeechInputControllerMock;
     54class WebSpeechInputListener;
     55}
    4956
    5057class TestShell;
     
    299306    void abortModal(const CppArgumentList&, CppVariant*);
    300307
     308    // Speech input related functions.
     309    void setMockSpeechInputResult(const CppArgumentList&, CppVariant*);
     310
    301311public:
    302312    // The following methods are not exposed to JavaScript.
    303313    void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
    304314
     315    WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
    305316    bool shouldDumpAsText() { return m_dumpAsText; }
    306317    bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
     
    473484
    474485    WebKit::WebURL m_userStyleSheetLocation;
     486
     487    OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
    475488};
    476489
  • trunk/WebKitTools/DumpRenderTree/chromium/TestShell.cpp

    r64614 r64749  
    4747#include "public/WebSettings.h"
    4848#include "public/WebSize.h"
     49#include "public/WebSpeechInputControllerMock.h"
    4950#include "public/WebString.h"
    5051#include "public/WebURLRequest.h"
  • trunk/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp

    r64710 r64749  
    502502}
    503503
     504WebSpeechInputController* WebViewHost::speechInputController(WebKit::WebSpeechInputListener* listener)
     505{
     506    return m_shell->layoutTestController()->speechInputController(listener);
     507}
     508
    504509// WebWidgetClient -----------------------------------------------------------
    505510
  • trunk/WebKitTools/DumpRenderTree/chromium/WebViewHost.h

    r61278 r64749  
    4747class WebFrame;
    4848class WebGeolocationServiceMock;
     49class WebSpeechInputController;
     50class WebSpeechInputListener;
    4951class WebURL;
    5052struct WebRect;
     
    127129    virtual WebKit::WebNotificationPresenter* notificationPresenter();
    128130    virtual WebKit::WebGeolocationService* geolocationService();
     131    virtual WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
    129132
    130133    // WebKit::WebWidgetClient
  • trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

    r64639 r64749  
    469469}
    470470
     471void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     472{
     473    // FIXME: Implement for speech input layout tests.
     474    // See https://bugs.webkit.org/show_bug.cgi?id=39485.
     475}
     476
    471477void LayoutTestController::setIconDatabaseEnabled(bool flag)
    472478{
  • trunk/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm

    r64639 r64749  
    363363}
    364364
     365void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     366{
     367    // FIXME: Implement for speech input layout tests.
     368    // See https://bugs.webkit.org/show_bug.cgi?id=39485.
     369}
     370
    365371void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
    366372{
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r64613 r64749  
    716716}
    717717
     718void LayoutTestController::setMockSpeechInputResult(const QString& result)
     719{
     720    // FIXME: Implement for speech input layout tests.
     721    // See https://bugs.webkit.org/show_bug.cgi?id=39485.
     722}
     723
    718724void LayoutTestController::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
    719725{
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r64613 r64749  
    209209    bool geolocationPermission() const { return m_geolocationPermission; }
    210210
     211    void setMockSpeechInputResult(const QString& result);
     212
    211213    // Empty stub method to keep parity with object model exposed by global LayoutTestController.
    212214    void abortModal() {}
  • trunk/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp

    r64639 r64749  
    400400}
    401401
     402void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     403{
     404    // FIXME: Implement for speech input layout tests.
     405    // See https://bugs.webkit.org/show_bug.cgi?id=39485.
     406}
     407
    402408void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
    403409{
  • trunk/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp

    r64639 r64749  
    306306}
    307307
     308void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     309{
     310    // FIXME: Implement for speech input layout tests.
     311    // See https://bugs.webkit.org/show_bug.cgi?id=39485.
     312}
     313
    308314void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
    309315{
Note: See TracChangeset for help on using the changeset viewer.