Changeset 70863 in webkit


Ignore:
Timestamp:
Oct 29, 2010 5:00:03 AM (13 years ago)
Author:
satish@chromium.org
Message:

2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>

Reviewed by Jeremy Orlow.

Added a layout test for the language tag in speech input. Updated
the speech button tests to include the new language parameter in the
mock result.
https://bugs.webkit.org/show_bug.cgi?id=47089

  • fast/speech/input-text-language-tag-expected.txt: Added.
  • fast/speech/input-text-language-tag.html: Added.
  • fast/speech/input-text-speechbutton.html:
  • fast/speech/speech-button-ignore-generated-events.html:
  • platform/chromium/test_expectations.txt:

2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>

Reviewed by Jeremy Orlow.

Patch the current speech input implementation to use the nearest
language tag. The language is now passed to the startRecognition
methods so that language-specific recognition could be used. Also added
a second parameter to setMockSpeechInputResult for the language used in
speech recognition.
https://bugs.webkit.org/show_bug.cgi?id=47089

This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
details see http://codereview.chromium.org/3615005/show,
http://codereview.chromium.org/3595018/show and
https://bugs.webkit.org/show_bug.cgi?id=47420.

Test: fast/speech/input-text-language-tag.html

  • page/SpeechInput.cpp: (WebCore::SpeechInput::startRecognition):
  • page/SpeechInput.h:
  • page/SpeechInputClient.h:
  • platform/mock/SpeechInputClientMock.cpp: (WebCore::SpeechInputClientMock::startRecognition): (WebCore::SpeechInputClientMock::setRecognitionResult): (WebCore::SpeechInputClientMock::timerFired):
  • platform/mock/SpeechInputClientMock.h:
  • rendering/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::attachInnerElement): (WebCore::SearchFieldCancelButtonElement::detach): (WebCore::SpinButtonElement::defaultEventHandler): (WebCore::InputFieldSpeechButtonElement::defaultEventHandler): (WebCore::InputFieldSpeechButtonElement::detach):

2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>

Reviewed by Jeremy Orlow.

Patch the current speech input implementation to use the nearest
language tag. The language is now passed to the startRecognition
methods so that language-specific recognition could be used. Also added
a second parameter to setMockSpeechInputResult for the language used in
speech recognition.
https://bugs.webkit.org/show_bug.cgi?id=47089

This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
details see http://codereview.chromium.org/3615005/show,
http://codereview.chromium.org/3595018/show and
https://bugs.webkit.org/show_bug.cgi?id=47420.

  • public/WebSpeechInputController.h: (WebKit::WebSpeechInputController::startRecognition):
  • public/WebSpeechInputControllerMock.h:
  • src/SpeechInputClientImpl.cpp: (WebKit::SpeechInputClientImpl::create): (WebKit::SpeechInputClientImpl::startRecognition):
  • src/SpeechInputClientImpl.h:
  • src/WebSpeechInputControllerMockImpl.cpp: (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult): (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
  • src/WebSpeechInputControllerMockImpl.h:
  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::WebViewImpl):
  • src/WebViewImpl.h:

2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>

Reviewed by Jeremy Orlow.

Added a second parameter to setMockSpeechInputResult for
the language used in speech input.
https://bugs.webkit.org/show_bug.cgi?id=47089

  • DumpRenderTree/LayoutTestController.cpp: (setMockSpeechInputResultCallback):
  • DumpRenderTree/LayoutTestController.h:
  • DumpRenderTree/chromium/LayoutTestController.cpp: (LayoutTestController::setMockSpeechInputResult):
  • DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: (LayoutTestController::setMockSpeechInputResult):
  • DumpRenderTree/mac/LayoutTestControllerMac.mm: (LayoutTestController::setMockSpeechInputResult):
  • DumpRenderTree/qt/LayoutTestControllerQt.cpp: (LayoutTestController::setMockSpeechInputResult):
  • DumpRenderTree/qt/LayoutTestControllerQt.h:
  • DumpRenderTree/win/LayoutTestControllerWin.cpp: (LayoutTestController::setMockSpeechInputResult):
  • DumpRenderTree/wx/LayoutTestControllerWx.cpp: (LayoutTestController::setMockSpeechInputResult): (LayoutTestController::pageSizeAndMarginsInPixels):
Location:
trunk
Files:
2 added
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70862 r70863  
     12010-10-29  Leandro Gracia Gil  <leandrogracia@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Added a layout test for the language tag in speech input. Updated
     6        the speech button tests to include the new language parameter in the
     7        mock result.
     8        https://bugs.webkit.org/show_bug.cgi?id=47089
     9
     10        * fast/speech/input-text-language-tag-expected.txt: Added.
     11        * fast/speech/input-text-language-tag.html: Added.
     12        * fast/speech/input-text-speechbutton.html:
     13        * fast/speech/speech-button-ignore-generated-events.html:
     14        * platform/chromium/test_expectations.txt:
     15
    1162010-10-29  Mads Ager  <ager@chromium.org>
    217
  • trunk/LayoutTests/fast/speech/input-text-speechbutton.html

    r70669 r70863  
    3333function run() {
    3434    if (window.layoutTestController && window.eventSender) {
    35         layoutTestController.setMockSpeechInputResult('Pictures of the moon');
     35        layoutTestController.setMockSpeechInputResult('Pictures of the moon', '');
    3636
    3737        // Clicking the speech button should fill in mock speech-recognized text.
  • trunk/LayoutTests/fast/speech/speech-button-ignore-generated-events.html

    r70669 r70863  
    5050    if (window.layoutTestController && window.eventSender) {
    5151        // Running in DRT, test the eventSender case.
    52         layoutTestController.setMockSpeechInputResult('Pictures of the moon');
     52        layoutTestController.setMockSpeechInputResult('Pictures of the moon', '');
    5353        document.getElementById('speechInput').onwebkitspeechchange = function() {
    5454            shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r70858 r70863  
    32693269// New test added by http://trac.webkit.org/changeset/70840.
    32703270BUGWK61188 : fast/repaint/iframe-scroll-repaint.html = IMAGE+TEXT IMAGE
     3271
     3272// Temporarily disabled for a 4-sided patch. Will be enabled again by BUGWK47420.
     3273BUGWK47089 : fast/speech/input-text-language-tag.html = FAIL
  • trunk/WebCore/ChangeLog

    r70862 r70863  
     12010-10-29  Leandro Gracia Gil  <leandrogracia@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Patch the current speech input implementation to use the nearest
     6        language tag. The language is now passed to the startRecognition
     7        methods so that language-specific recognition could be used. Also added
     8        a second parameter to setMockSpeechInputResult for the language used in
     9        speech recognition.
     10        https://bugs.webkit.org/show_bug.cgi?id=47089
     11
     12        This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
     13        details see http://codereview.chromium.org/3615005/show,
     14        http://codereview.chromium.org/3595018/show and
     15        https://bugs.webkit.org/show_bug.cgi?id=47420.
     16
     17        Test: fast/speech/input-text-language-tag.html
     18
     19        * page/SpeechInput.cpp:
     20        (WebCore::SpeechInput::startRecognition):
     21        * page/SpeechInput.h:
     22        * page/SpeechInputClient.h:
     23        * platform/mock/SpeechInputClientMock.cpp:
     24        (WebCore::SpeechInputClientMock::startRecognition):
     25        (WebCore::SpeechInputClientMock::setRecognitionResult):
     26        (WebCore::SpeechInputClientMock::timerFired):
     27        * platform/mock/SpeechInputClientMock.h:
     28        * rendering/TextControlInnerElements.cpp:
     29        (WebCore::TextControlInnerElement::attachInnerElement):
     30        (WebCore::SearchFieldCancelButtonElement::detach):
     31        (WebCore::SpinButtonElement::defaultEventHandler):
     32        (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
     33        (WebCore::InputFieldSpeechButtonElement::detach):
     34
    1352010-10-29  Mads Ager  <ager@chromium.org>
    236
  • trunk/WebCore/page/SpeechInput.cpp

    r70669 r70863  
    9494}
    9595
    96 bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect, const String& grammar)
     96bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect, const AtomicString& language, const String& grammar)
    9797{
    9898    ASSERT(m_listeners.contains(listenerId));
    99     return m_client->startRecognition(listenerId, elementRect, grammar);
     99    return m_client->startRecognition(listenerId, elementRect, language, grammar);
    100100}
    101101
  • trunk/WebCore/page/SpeechInput.h

    r70669 r70863  
    6262
    6363    // Methods invoked by the input elements.
    64     bool startRecognition(int listenerId, const IntRect& elementRect, const String& grammar);
     64    bool startRecognition(int listenerId, const IntRect& elementRect, const AtomicString& language, const String& grammar);
    6565    void stopRecording(int);
    6666    void cancelRecognition(int);
  • trunk/WebCore/page/SpeechInputClient.h

    r70669 r70863  
    5151
    5252    // Starts speech recognition and audio recording.
    53     virtual bool startRecognition(int requestId, const IntRect& elementRect, const String& grammar) = 0;
     53    virtual bool startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar) = 0;
    5454
    5555    // Stops audio recording and performs recognition with the audio recorded until now
  • trunk/WebCore/platform/mock/SpeechInputClientMock.cpp

    r70669 r70863  
    5151}
    5252
    53 bool SpeechInputClientMock::startRecognition(int requestId, const IntRect& elementRect, const String& grammar)
     53bool SpeechInputClientMock::startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar)
    5454{
    5555    if (m_timer.isActive())
     
    5757    m_requestId = requestId;
    5858    m_recording = true;
     59    m_language = language;
    5960    m_timer.startOneShot(0);
    6061    return true;
     
    8182}
    8283
    83 void SpeechInputClientMock::setRecognitionResult(const String& result)
     84void SpeechInputClientMock::setRecognitionResult(const String& result, const AtomicString& language)
    8485{
    85     m_recognitionResult = result;
     86    if (language.isEmpty())
     87        m_resultForEmptyLanguage = result;
     88    else
     89        m_recognitionResult.set(language, result);
    8690}
    8791
     
    9498    } else {
    9599        SpeechInputResultArray results;
    96         results.append(SpeechInputResult::create(m_recognitionResult, 1.0));
     100        bool noResultsFound = false;
     101
     102        // Empty language case must be handled separately to avoid problems with HashMap and empty keys.
     103        if (m_language.isEmpty()) {
     104            if (!m_resultForEmptyLanguage.isNull())
     105                results.append(SpeechInputResult::create(m_resultForEmptyLanguage, 1.0));
     106            else
     107                noResultsFound = true;
     108        } else {
     109            if (m_recognitionResult.contains(m_language))
     110                results.append(SpeechInputResult::create(m_recognitionResult.get(m_language), 1.0));
     111            else
     112                noResultsFound = true;
     113        }
     114
     115        if (noResultsFound) {
     116            // Can't avoid setting a result even if no result was set for the given language.
     117            // This would avoid generating the events used to check the results and the test would timeout.
     118            String error("error: no result found for language '");
     119            error.append(m_language);
     120            error.append("'");
     121            results.append(SpeechInputResult::create(error, 1.0));
     122        }
     123
    97124        m_listener->setRecognitionResult(m_requestId, results);
    98125        m_listener->didCompleteRecognition(m_requestId);
  • trunk/WebCore/platform/mock/SpeechInputClientMock.h

    r70669 r70863  
    3535#include "SpeechInputClient.h"
    3636#include "Timer.h"
     37#include <wtf/HashMap.h>
     38#include <wtf/text/StringHash.h>
    3739
    3840#if ENABLE(INPUT_SPEECH)
     
    4749    SpeechInputClientMock();
    4850
    49     void setRecognitionResult(const String& result);
     51    void setRecognitionResult(const String& result, const AtomicString& language);
    5052
    5153    // SpeechInputClient methods.
    5254    void setListener(SpeechInputListener*);
    53     bool startRecognition(int requestId, const IntRect& elementRect, const String& grammar);
     55    bool startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar);
    5456    void stopRecording(int);
    5557    void cancelRecognition(int);
     
    6264    SpeechInputListener* m_listener;
    6365    int m_requestId;
    64     String m_recognitionResult;
     66
     67    HashMap<String, String> m_recognitionResult;
     68    AtomicString m_language;
     69    String m_resultForEmptyLanguage;
    6570};
    6671
  • trunk/WebCore/rendering/TextControlInnerElements.cpp

    r70669 r70863  
    2222 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2323 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2525 */
    26  
     26
    2727#include "config.h"
    2828#include "TextControlInnerElements.h"
     
    108108        renderer->setStyle(style);
    109109    }
    110    
     110
    111111    // Set these explicitly since this normally happens during an attach()
    112112    setAttached();
    113113    setInDocument();
    114    
     114
    115115    // For elements without a shadow parent, add the node to the DOM normally.
    116116    if (!m_shadowParent) {
     
    119119        parent->deprecatedParserAddChild(this);
    120120    }
    121  
     121
    122122    // Add the renderer to the render tree
    123123    if (renderer)
     
    209209    if (m_capturing) {
    210210        if (Frame* frame = document()->frame())
    211             frame->eventHandler()->setCapturingMouseEventsNode(0);     
     211            frame->eventHandler()->setCapturingMouseEventsNode(0);
    212212    }
    213213    TextControlInnerElement::detach();
     
    282282        if (!event->defaultHandled())
    283283            HTMLDivElement::defaultEventHandler(event);
    284         return;       
    285     }
    286    
     284        return;
     285    }
     286
    287287    HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
    288288    if (input->disabled() || input->isReadOnlyFormControl()) {
     
    432432        switch (m_state) {
    433433        case Idle:
    434             if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect(), input->getAttribute(webkitgrammarAttr)))
     434            if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect(), input->computeInheritedLanguage(), input->getAttribute(webkitgrammarAttr)))
    435435                setState(Recording);
    436436            break;
     
    490490    if (m_capturing) {
    491491        if (Frame* frame = document()->frame())
    492             frame->eventHandler()->setCapturingMouseEventsNode(0);     
     492            frame->eventHandler()->setCapturingMouseEventsNode(0);
    493493    }
    494494
  • trunk/WebKit/chromium/ChangeLog

    r70846 r70863  
     12010-10-29  Leandro Gracia Gil  <leandrogracia@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Patch the current speech input implementation to use the nearest
     6        language tag. The language is now passed to the startRecognition
     7        methods so that language-specific recognition could be used. Also added
     8        a second parameter to setMockSpeechInputResult for the language used in
     9        speech recognition.
     10        https://bugs.webkit.org/show_bug.cgi?id=47089
     11
     12        This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
     13        details see http://codereview.chromium.org/3615005/show,
     14        http://codereview.chromium.org/3595018/show and
     15        https://bugs.webkit.org/show_bug.cgi?id=47420.
     16
     17        * public/WebSpeechInputController.h:
     18        (WebKit::WebSpeechInputController::startRecognition):
     19        * public/WebSpeechInputControllerMock.h:
     20        * src/SpeechInputClientImpl.cpp:
     21        (WebKit::SpeechInputClientImpl::create):
     22        (WebKit::SpeechInputClientImpl::startRecognition):
     23        * src/SpeechInputClientImpl.h:
     24        * src/WebSpeechInputControllerMockImpl.cpp:
     25        (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
     26        (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
     27        * src/WebSpeechInputControllerMockImpl.h:
     28        * src/WebViewImpl.cpp:
     29        (WebKit::WebViewImpl::WebViewImpl):
     30        * src/WebViewImpl.h:
     31
    1322010-10-28  Adam Barth  <abarth@webkit.org>
    233
  • trunk/WebKit/chromium/public/WebSpeechInputController.h

    r70769 r70863  
    3636namespace WebKit {
    3737
     38class WebString;
    3839struct WebRect;
    3940class WebString;
     
    4546    // runs to the limit or stopRecording is called. Progress indications and the recognized
    4647    // text are returned via the listener interface.
    47     virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar)
     48    virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar)
    4849    {
    4950        WEBKIT_ASSERT_NOT_REACHED();
  • trunk/WebKit/chromium/public/WebSpeechInputControllerMock.h

    r70669 r70863  
    4545    virtual ~WebSpeechInputControllerMock() { }
    4646
     47    virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0;
     48
     49    // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched.
     50    // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch.
    4751    virtual void setMockRecognitionResult(const WebString& result) = 0;
    4852};
  • trunk/WebKit/chromium/src/SpeechInputClientImpl.cpp

    r70669 r70863  
    3333
    3434#include "PlatformString.h"
     35#include "SpeechInputListener.h"
    3536#include "WebSpeechInputController.h"
    3637#include "WebString.h"
    3738#include "WebViewClient.h"
    38 #include "page/SpeechInputListener.h"
     39#include <wtf/PassOwnPtr.h>
    3940
    4041#if ENABLE(INPUT_SPEECH)
    4142
    4243namespace WebKit {
     44
     45PassOwnPtr<SpeechInputClientImpl> SpeechInputClientImpl::create(WebViewClient* client)
     46{
     47    return adoptPtr(new SpeechInputClientImpl(client));
     48}
    4349
    4450SpeechInputClientImpl::SpeechInputClientImpl(WebViewClient* web_view_client)
     
    5763}
    5864
    59 bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect, const WTF::String& grammar)
     65bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect, const AtomicString& language, const String& grammar)
    6066{
    6167    ASSERT(m_listener);
    62     return m_controller->startRecognition(requestId, elementRect, grammar);
     68    return m_controller->startRecognition(requestId, elementRect, language, grammar);
    6369}
    6470
  • trunk/WebKit/chromium/src/SpeechInputClientImpl.h

    r70669 r70863  
    3434#if ENABLE(INPUT_SPEECH)
    3535
     36#include "SpeechInputClient.h"
    3637#include "WebSpeechInputListener.h"
    37 #include "page/SpeechInputClient.h"
     38#include <wtf/Forward.h>
     39#include <wtf/OwnPtr.h>
     40#include <wtf/PassOwnPtr.h>
    3841
    3942namespace WebCore {
     
    5053      public WebSpeechInputListener {
    5154public:
    52     SpeechInputClientImpl(WebViewClient*);
     55    static PassOwnPtr<SpeechInputClientImpl> create(WebViewClient*);
    5356    virtual ~SpeechInputClientImpl();
    5457
    5558    // SpeechInputClient methods.
    5659    void setListener(WebCore::SpeechInputListener*);
    57     bool startRecognition(int requestId, const WebCore::IntRect& elementRect, const WTF::String& grammar);
     60    bool startRecognition(int requestId, const WebCore::IntRect& elementRect, const AtomicString& language, const String& grammar);
    5861    void stopRecording(int);
    5962    void cancelRecognition(int);
     
    6568
    6669private:
     70    SpeechInputClientImpl(WebViewClient*);
     71
    6772    WebSpeechInputController* m_controller; // To call into the embedder.
    6873    WebCore::SpeechInputListener* m_listener;
  • trunk/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp

    r70669 r70863  
    5858void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result)
    5959{
    60     m_webcoreMock->setRecognitionResult(result);
     60    m_webcoreMock->setRecognitionResult(result, WebString::fromUTF8(""));
     61}
     62
     63void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result, const WebString &language)
     64{
     65    m_webcoreMock->setRecognitionResult(result, language);
    6166}
    6267
     
    7681}
    7782
    78 bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar)
     83bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar)
    7984{
    80     return m_webcoreMock->startRecognition(requestId, elementRect, grammar);
     85    return m_webcoreMock->startRecognition(requestId, elementRect, language, grammar);
    8186}
    8287
  • trunk/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h

    r70669 r70863  
    5858
    5959    // WebSpeechInputController methods.
    60     bool startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar);
     60    bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar);
    6161    void cancelRecognition(int requestId);
    6262    void stopRecording(int requestId);
    6363
    6464    // WebSpeechInputControllerMock methods.
     65    void setMockRecognitionResult(const WebString& result, const WebString& language);
     66
     67    // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched.
     68    // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch.
    6569    void setMockRecognitionResult(const WebString& result);
    6670
     
    7377
    7478#endif // WebSpeechInputControllerMockImpl_h
    75 
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r70669 r70863  
    8989#include "SelectionController.h"
    9090#include "Settings.h"
     91#include "SpeechInputClientImpl.h"
    9192#include "Timer.h"
    9293#include "TypingCommand.h"
     
    283284#endif
    284285#if ENABLE(INPUT_SPEECH)
    285     , m_speechInputClient(client)
     286    , m_speechInputClient(SpeechInputClientImpl::create(client))
    286287#endif
    287288    , m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0))
     
    306307    pageClients.inspectorClient = &m_inspectorClientImpl;
    307308#if ENABLE(INPUT_SPEECH)
    308     pageClients.speechInputClient = &m_speechInputClient;
     309    pageClients.speechInputClient = m_speechInputClient.get();
    309310#endif
    310311    pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get();
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r70669 r70863  
    5050#include "LayerRendererChromium.h"
    5151#include "NotificationPresenterImpl.h"
    52 #include "SpeechInputClientImpl.h"
    5352#include <wtf/OwnPtr.h>
    5453#include <wtf/RefCounted.h>
     
    7574class DeviceOrientationClientProxy;
    7675class DragScrollTimer;
     76class SpeechInputClientImpl;
    7777class WebAccessibilityObject;
    7878class WebDevToolsAgentClient;
     
    549549
    550550#if ENABLE(INPUT_SPEECH)
    551     SpeechInputClientImpl m_speechInputClient;
     551    OwnPtr<SpeechInputClientImpl> m_speechInputClient;
    552552#endif
    553553    // If we attempt to fetch the on-screen GraphicsContext3D before
  • trunk/WebKitTools/ChangeLog

    r70822 r70863  
     12010-10-29  Leandro Gracia Gil  <leandrogracia@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Added a second parameter to setMockSpeechInputResult for
     6        the language used in speech input.
     7        https://bugs.webkit.org/show_bug.cgi?id=47089
     8
     9        * DumpRenderTree/LayoutTestController.cpp:
     10        (setMockSpeechInputResultCallback):
     11        * DumpRenderTree/LayoutTestController.h:
     12        * DumpRenderTree/chromium/LayoutTestController.cpp:
     13        (LayoutTestController::setMockSpeechInputResult):
     14        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
     15        (LayoutTestController::setMockSpeechInputResult):
     16        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
     17        (LayoutTestController::setMockSpeechInputResult):
     18        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     19        (LayoutTestController::setMockSpeechInputResult):
     20        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     21        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
     22        (LayoutTestController::setMockSpeechInputResult):
     23        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
     24        (LayoutTestController::setMockSpeechInputResult):
     25        (LayoutTestController::pageSizeAndMarginsInPixels):
     26
    1272010-10-28  Ojan Vafai  <ojan@chromium.org>
    228
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp

    r70669 r70863  
    10791079static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    10801080{
    1081     if (argumentCount < 1)
     1081    if (argumentCount < 2)
    10821082        return JSValueMakeUndefined(context);
    10831083
     
    10851085    ASSERT(!*exception);
    10861086
    1087     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
    1088     controller->setMockSpeechInputResult(result.get());
     1087    JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[1], exception));
     1088    ASSERT(!*exception);
     1089
     1090    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
     1091    controller->setMockSpeechInputResult(result.get(), language.get());
    10891092
    10901093    return JSValueMakeUndefined(context);
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.h

    r70669 r70863  
    9595    void setMockGeolocationError(int code, JSStringRef message);
    9696    void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
    97     void setMockSpeechInputResult(JSStringRef result);
     97    void setMockSpeechInputResult(JSStringRef result, JSStringRef language);
    9898    void setPersistentUserStyleSheetLocation(JSStringRef path);
    9999    void setPluginsEnabled(bool flag);
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp

    r70669 r70863  
    15351535{
    15361536    result->setNull();
    1537     if (arguments.size() < 1 || !arguments[0].isString())
    1538         return;
    1539 
    1540     m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]));
     1537    if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isString())
     1538        return;
     1539
     1540    m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]), cppVariantToWebString(arguments[1]));
    15411541}
    15421542
  • trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

    r70669 r70863  
    502502}
    503503
    504 void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     504void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
    505505{
    506506    // FIXME: Implement for speech input layout tests.
  • trunk/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm

    r70669 r70863  
    372372}
    373373
    374 void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     374void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
    375375{
    376376    // FIXME: Implement for speech input layout tests.
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r70669 r70863  
    766766}
    767767
    768 void LayoutTestController::setMockSpeechInputResult(const QString& result)
     768void LayoutTestController::setMockSpeechInputResult(const QString& result, const QString& language)
    769769{
    770770    // FIXME: Implement for speech input layout tests.
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r70669 r70863  
    217217    bool geolocationPermission() const { return m_geolocationPermission; }
    218218
    219     void setMockSpeechInputResult(const QString& result);
     219    void setMockSpeechInputResult(const QString& result, const QString& language);
    220220
    221221    // Empty stub method to keep parity with object model exposed by global LayoutTestController.
  • trunk/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp

    r70669 r70863  
    406406}
    407407
    408 void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     408void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
    409409{
    410410    // FIXME: Implement for speech input layout tests.
  • trunk/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp

    r70669 r70863  
    321321}
    322322
    323 void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     323void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
    324324{
    325325    // FIXME: Implement for speech input layout tests.
     
    529529    return 0;
    530530}
    531 
Note: See TracChangeset for help on using the changeset viewer.