Changeset 70149 in webkit


Ignore:
Timestamp:
Oct 20, 2010 8:56:03 AM (13 years ago)
Author:
andreip@google.com
Message:

2010-10-19 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: Added an empty language parameter.
  • fast/speech/speech-button-ignore-generated-events.html: Added an empty language parameter.
  • platform/chromium/test_expectations.txt: language tag test is expected to fail until the chromium-side patch has been applied.

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

Reviewed by Jeremy Orlow.

Patch the current speech input implementation to use and validate 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 and
http://codereview.chromium.org/3595018/show.

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

  • dom/Element.cpp: (WebCore::Element::computeInheritedLanguage): includes a brief character validation for the BCP 47 language tag.
  • page/SpeechInput.cpp: (WebCore::SpeechInput::startRecognition):
  • page/SpeechInput.h:
  • page/SpeechInputClient.h:
  • platform/mock/SpeechInputClientMock.cpp: (WebCore::SpeechInputClientMock::startRecognition): (WebCore::SpeechInputClientMock::setRecognitionResult): results are now stored by language using a hash map. (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-19 Leandro Gracia Gil <leandrogracia@google.com>

Reviewed by Jeremy Orlow.

Patch the current speech input implementation to use and validate 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 and
http://codereview.chromium.org/3595018/show.

  • 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-19 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):
Location:
trunk
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70147 r70149  
     12010-10-19  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: Added an empty language
     13          parameter.
     14        * fast/speech/speech-button-ignore-generated-events.html: Added an
     15          empty language parameter.
     16        * platform/chromium/test_expectations.txt: language tag test is expected
     17          to fail until the chromium-side patch has been applied.
     18
    1192010-10-19  Antonio Gomes  <agomes@rim.com>
    220
  • trunk/LayoutTests/fast/speech/input-text-speechbutton.html

    r69100 r70149  
    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

    r69100 r70149  
    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

    r70147 r70149  
    32433243// r69833, JSC/V8 Date parsing differences
    32443244BUGJAPHET : fast/js/date-parse-test.html = TEXT
     3245
     3246// Temporarily disabled for a 4-sided patch. Will be enabled again by BUGWK47420.
     3247BUGWK47089 : fast/speech/input-text-language-tag.html = FAIL
  • trunk/WebCore/ChangeLog

    r70143 r70149  
     12010-10-19  Leandro Gracia Gil  <leandrogracia@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Patch the current speech input implementation to use and validate the
     6        nearest 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 and
     14        http://codereview.chromium.org/3595018/show.
     15
     16        Test: fast/speech/input-text-language-tag.html
     17
     18        * dom/Element.cpp:
     19        (WebCore::Element::computeInheritedLanguage): includes a brief character
     20          validation for the BCP 47 language tag.
     21        * page/SpeechInput.cpp:
     22        (WebCore::SpeechInput::startRecognition):
     23        * page/SpeechInput.h:
     24        * page/SpeechInputClient.h:
     25        * platform/mock/SpeechInputClientMock.cpp:
     26        (WebCore::SpeechInputClientMock::startRecognition):
     27        (WebCore::SpeechInputClientMock::setRecognitionResult): results are now
     28          stored by language using a hash map.
     29        (WebCore::SpeechInputClientMock::timerFired):
     30        * platform/mock/SpeechInputClientMock.h:
     31        * rendering/TextControlInnerElements.cpp:
     32        (WebCore::TextControlInnerElement::attachInnerElement):
     33        (WebCore::SearchFieldCancelButtonElement::detach):
     34        (WebCore::SpinButtonElement::defaultEventHandler):
     35        (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
     36        (WebCore::InputFieldSpeechButtonElement::detach):
     37
    1382010-10-20  Dirk Schulze  <krit@webkit.org>
    239
  • trunk/WebCore/dom/Element.cpp

    r69868 r70149  
    5757#include "TextIterator.h"
    5858#include "XMLNames.h"
     59#include <wtf/ASCIICType.h>
    5960#include <wtf/text/CString.h>
    6061
     
    14751476    }
    14761477
     1478    if (!value.isNull() && !value.isEmpty()) {
     1479        // Only A-Za-z0-9 and '-' are allowed in the language tag (see BCP 47)
     1480        const char *p = value.string().ascii().data();
     1481        for (; *p != '\0'; ++p) {
     1482            if (!isASCIIAlphanumeric(*p) && *p != '-')
     1483                return AtomicString();
     1484        }
     1485    }
     1486
    14771487    return value;
    14781488}
  • trunk/WebCore/page/SpeechInput.cpp

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

    r66007 r70149  
    6262
    6363    // Methods invoked by the input elements.
    64     bool startRecognition(int, const IntRect&);
     64    bool startRecognition(int, const String&, const IntRect&);
    6565    void stopRecording(int);
    6666    void cancelRecognition(int);
  • trunk/WebCore/page/SpeechInputClient.h

    r66007 r70149  
    3232#define SpeechInputClient_h
    3333
     34#include <wtf/Forward.h>
     35
    3436#if ENABLE(INPUT_SPEECH)
    3537
     
    4951
    5052    // Starts speech recognition and audio recording.
    51     virtual bool startRecognition(int requestId, const IntRect& elementRect) = 0;
     53    virtual bool startRecognition(int requestId, const String& language, const IntRect& elementRect) = 0;
    5254
    5355    // Stops audio recording and performs recognition with the audio recorded until now
  • trunk/WebCore/platform/mock/SpeechInputClientMock.cpp

    r66007 r70149  
    3636#include "SpeechInputListener.h"
    3737
     38namespace {
     39    // HashMap doesn't support empty strings as keys, so this value (an invalid BCP47 tag) is used for those cases.
     40    const String emptyLanguage = "_";
     41}
     42
    3843namespace WebCore {
    3944
     
    5156}
    5257
    53 bool SpeechInputClientMock::startRecognition(int requestId, const IntRect&)
     58bool SpeechInputClientMock::startRecognition(int requestId, const String& language, const IntRect&)
    5459{
    5560    if (m_timer.isActive())
     
    5762    m_requestId = requestId;
    5863    m_recording = true;
     64    m_language = language;
    5965    m_timer.startOneShot(0);
    6066    return true;
     
    8187}
    8288
    83 void SpeechInputClientMock::setRecognitionResult(const String& result)
     89void SpeechInputClientMock::setRecognitionResult(const String& result, const String& language)
    8490{
    85     m_recognitionResult = result;
     91    if (language.isEmpty())
     92        m_recognitionResult.set(emptyLanguage, result);
     93    else
     94        m_recognitionResult.set(language, result);
    8695}
    8796
     
    93102        m_timer.startOneShot(0);
    94103    } else {
    95         m_listener->setRecognitionResult(m_requestId, m_recognitionResult);
     104        String language = m_language.isEmpty() ? String(emptyLanguage) : m_language;
     105        if (!m_recognitionResult.contains(language)) {
     106            // Can't avoid setting a result on empty or invalid language strings.
     107            // This would avoid generating the events used to check the results and the test would timeout.
     108            String error("error: no result found for language '");
     109            error.append(m_language);
     110            error.append("'");
     111            m_listener->setRecognitionResult(m_requestId, error);
     112        } else
     113            m_listener->setRecognitionResult(m_requestId, m_recognitionResult.get(language));
     114
    96115        m_listener->didCompleteRecognition(m_requestId);
    97116        m_requestId = 0;
  • trunk/WebCore/platform/mock/SpeechInputClientMock.h

    r66007 r70149  
    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 String& language);
    5052
    5153    // SpeechInputClient methods.
    5254    void setListener(SpeechInputListener*);
    53     bool startRecognition(int, const IntRect&);
     55    bool startRecognition(int, const String&, const IntRect&);
    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    String m_language;
    6569};
    6670
  • trunk/WebCore/rendering/TextControlInnerElements.cpp

    r69100 r70149  
    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()))
     434            if (speechInput()->startRecognition(m_listenerId, input->computeInheritedLanguage(), input->renderer()->absoluteBoundingBoxRect()))
    435435                setState(Recording);
    436436            break;
     
    488488    if (m_capturing) {
    489489        if (Frame* frame = document()->frame())
    490             frame->eventHandler()->setCapturingMouseEventsNode(0);     
     490            frame->eventHandler()->setCapturingMouseEventsNode(0);
    491491    }
    492492
  • trunk/WebKit/chromium/ChangeLog

    r70145 r70149  
     12010-10-19  Leandro Gracia Gil  <leandrogracia@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4 
     5        Patch the current speech input implementation to use and validate the
     6        nearest 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 and
     14        http://codereview.chromium.org/3595018/show.
     15
     16        * public/WebSpeechInputController.h:
     17        (WebKit::WebSpeechInputController::startRecognition):
     18        * public/WebSpeechInputControllerMock.h:
     19        * src/SpeechInputClientImpl.cpp:
     20        (WebKit::SpeechInputClientImpl::create):
     21        (WebKit::SpeechInputClientImpl::startRecognition):
     22        * src/SpeechInputClientImpl.h:
     23        * src/WebSpeechInputControllerMockImpl.cpp:
     24        (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
     25        (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
     26        * src/WebSpeechInputControllerMockImpl.h:
     27        * src/WebViewImpl.cpp:
     28        (WebKit::WebViewImpl::WebViewImpl):
     29        * src/WebViewImpl.h:
     30
    1312010-10-20  Dirk Schulze  <krit@webkit.org>
    232
  • trunk/WebKit/chromium/public/WebSpeechInputController.h

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

    r64907 r70149  
    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

    r66007 r70149  
    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)
     65bool SpeechInputClientImpl::startRecognition(int requestId, const String& language, const WebCore::IntRect& elementRect)
    6066{
    6167    ASSERT(m_listener);
    62     return m_controller->startRecognition(requestId, elementRect);
     68    return m_controller->startRecognition(requestId, language, elementRect);
    6369}
    6470
  • trunk/WebKit/chromium/src/SpeechInputClientImpl.h

    r66007 r70149  
    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>
     41
     42namespace WTF {
     43class String;
     44}
    3845
    3946namespace WebCore {
     
    5057      public WebSpeechInputListener {
    5158public:
    52     SpeechInputClientImpl(WebViewClient*);
     59    static PassOwnPtr<SpeechInputClientImpl> create(WebViewClient*);
    5360    virtual ~SpeechInputClientImpl();
    5461
    5562    // SpeechInputClient methods.
    5663    void setListener(WebCore::SpeechInputListener*);
    57     bool startRecognition(int, const WebCore::IntRect&);
     64    bool startRecognition(int, const String&, const WebCore::IntRect&);
    5865    void stopRecording(int);
    5966    void cancelRecognition(int);
     
    6572
    6673private:
     74    SpeechInputClientImpl(WebViewClient*);
     75
    6776    WebSpeechInputController* m_controller; // To call into the embedder.
    6877    WebCore::SpeechInputListener* m_listener;
  • trunk/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp

    r66007 r70149  
    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)
     83bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebString& language, const WebRect& elementRect)
    7984{
    80     return m_webcoreMock->startRecognition(requestId, elementRect);
     85    return m_webcoreMock->startRecognition(requestId, language, elementRect);
    8186}
    8287
  • trunk/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h

    r66007 r70149  
    3838#include <wtf/OwnPtr.h>
    3939
     40namespace WTF {
     41class String;
     42}
     43
    4044namespace WebCore {
    4145class SpeechInputClientMock;
     
    5862
    5963    // WebSpeechInputController methods.
    60     bool startRecognition(int requestId, const WebRect& elementRect);
     64    bool startRecognition(int requestId, const WebString& language, const WebRect& elementRect);
    6165    void cancelRecognition(int requestId);
    6266    void stopRecording(int requestId);
    6367
    6468    // WebSpeechInputControllerMock methods.
     69    void setMockRecognitionResult(const WebString& result, const WebString& language);
     70
     71    // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched.
     72    // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch.
    6573    void setMockRecognitionResult(const WebString& result);
    6674
     
    7381
    7482#endif // WebSpeechInputControllerMockImpl_h
    75 
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r70143 r70149  
    8989#include "SelectionController.h"
    9090#include "Settings.h"
     91#include "SpeechInputClientImpl.h"
    9192#include "Timer.h"
    9293#include "TypingCommand.h"
     
    276277#endif
    277278#if ENABLE(INPUT_SPEECH)
    278     , m_speechInputClient(client)
     279    , m_speechInputClient(SpeechInputClientImpl::create(client))
    279280#endif
    280281    , m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0))
     
    299300    pageClients.inspectorClient = &m_inspectorClientImpl;
    300301#if ENABLE(INPUT_SPEECH)
    301     pageClients.speechInputClient = &m_speechInputClient;
     302    pageClients.speechInputClient = m_speechInputClient.get();
    302303#endif
    303304    pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get();
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r69624 r70149  
    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;
     
    544544
    545545#if ENABLE(INPUT_SPEECH)
    546     SpeechInputClientImpl m_speechInputClient;
     546    OwnPtr<SpeechInputClientImpl> m_speechInputClient;
    547547#endif
    548548    // If we attempt to fetch the on-screen GraphicsContext3D before
  • trunk/WebKitTools/ChangeLog

    r70128 r70149  
     12010-10-19  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
    1172010-10-19  Adam Roben  <aroben@apple.com>
    218
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp

    r69952 r70149  
    10711071static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    10721072{
    1073     if (argumentCount < 1)
     1073    if (argumentCount < 2)
    10741074        return JSValueMakeUndefined(context);
    10751075
     
    10771077    ASSERT(!*exception);
    10781078
    1079     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
    1080     controller->setMockSpeechInputResult(result.get());
     1079    JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[1], exception));
     1080    ASSERT(!*exception);
     1081
     1082    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
     1083    controller->setMockSpeechInputResult(result.get(), language.get());
    10811084
    10821085    return JSValueMakeUndefined(context);
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.h

    r69952 r70149  
    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 languageTag);
    9898    void setPersistentUserStyleSheetLocation(JSStringRef path);
    9999    void setPluginsEnabled(bool flag);
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp

    r70064 r70149  
    15271527{
    15281528    result->setNull();
    1529     if (arguments.size() < 1 || !arguments[0].isString())
    1530         return;
    1531 
    1532     m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]));
     1529    if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isString())
     1530        return;
     1531
     1532    m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]), cppVariantToWebString(arguments[1]));
    15331533}
    15341534
  • trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

    r70039 r70149  
    501501}
    502502
    503 void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
     503void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
    504504{
    505505    // FIXME: Implement for speech input layout tests.
Note: See TracChangeset for help on using the changeset viewer.