Changeset 106219 in webkit


Ignore:
Timestamp:
Jan 30, 2012 1:31:58 AM (12 years ago)
Author:
hans@chromium.org
Message:

Speech Input: move MockSpeechInputClient into Chromium DumpRenderTree implementation
https://bugs.webkit.org/show_bug.cgi?id=77083

Reviewed by Darin Fisher.

Source/WebCore:

Remove SpeechInputClientMock. The mock is moving to the DumpRenderTree
implementation.

No new tests, just refactoring.

  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/mock/SpeechInputClientMock.cpp: Removed.
  • platform/mock/SpeechInputClientMock.h: Removed.

Source/WebKit/chromium:

Remove the WebSpeechInputControllerMock interface and proxy
implementation. The mock is moving to the DumpRenderTree
implementation instead, which removes the need to expose this
interface in the WebKit API.

Also add a proper copy constructor for WebSpeechInputResult.
The default one doesn't do a proper copy.

  • WebKit.gyp:
  • public/WebSpeechInputControllerMock.h: Removed.
  • public/WebSpeechInputResult.h:

(WebKit::WebSpeechInputResult::WebSpeechInputResult):
(WebSpeechInputResult):

  • src/WebSpeechInputControllerMockImpl.cpp: Removed.
  • src/WebSpeechInputControllerMockImpl.h: Removed.
  • src/WebSpeechInputResult.cpp:

(WebKit::WebSpeechInputResult::set):
(WebKit):

Tools:

Add MockWebSpeechInputController which provides a mock implementation
of the WebSpeechInputController interface, and use that in
DumpRenderTree.

  • DumpRenderTree/DumpRenderTree.gypi:
  • DumpRenderTree/chromium/LayoutTestController.cpp:

(LayoutTestController::addMockSpeechInputResult):

  • DumpRenderTree/chromium/LayoutTestController.h:

():

  • DumpRenderTree/chromium/MockWebSpeechInputController.cpp: Added.

(MockWebSpeechInputController::create):
(MockWebSpeechInputController::addMockRecognitionResult):
(MockWebSpeechInputController::clearResults):
(MockWebSpeechInputController::startRecognition):
(MockWebSpeechInputController::cancelRecognition):
(MockWebSpeechInputController::stopRecording):
(MockWebSpeechInputController::MockWebSpeechInputController):
(MockWebSpeechInputController::speechTaskFired):
(MockWebSpeechInputController::SpeechTask::SpeechTask):
(MockWebSpeechInputController::SpeechTask::stop):
(MockWebSpeechInputController::SpeechTask::runIfValid):

  • DumpRenderTree/chromium/MockWebSpeechInputController.h: Added.

(WebKit):
(MockWebSpeechInputController):
(MockWebSpeechInputController::taskList):
(SpeechTask):

  • DumpRenderTree/chromium/TestShell.cpp:
  • DumpRenderTree/chromium/WebViewHost.cpp:

(WebViewHost::speechInputController):

  • DumpRenderTree/chromium/WebViewHost.h:

(WebKit):
(WebViewHost::speechInputControllerMock):
(WebViewHost):
():

Location:
trunk
Files:
2 added
5 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106218 r106219  
     12012-01-26  Hans Wennborg  <hans@chromium.org>
     2
     3        Speech Input: move MockSpeechInputClient into Chromium DumpRenderTree implementation
     4        https://bugs.webkit.org/show_bug.cgi?id=77083
     5
     6        Reviewed by Darin Fisher.
     7
     8        Remove SpeechInputClientMock. The mock is moving to the DumpRenderTree
     9        implementation.
     10
     11        No new tests, just refactoring.
     12
     13        * GNUmakefile.list.am:
     14        * Target.pri:
     15        * WebCore.gypi:
     16        * WebCore.vcproj/WebCore.vcproj:
     17        * WebCore.xcodeproj/project.pbxproj:
     18        * platform/mock/SpeechInputClientMock.cpp: Removed.
     19        * platform/mock/SpeechInputClientMock.h: Removed.
     20
    1212012-01-30  Peter Rybin  <peter.rybin@gmail.com>
    222
  • trunk/Source/WebCore/GNUmakefile.list.am

    r106217 r106219  
    31423142        Source/WebCore/platform/mock/ScrollbarThemeMock.cpp \
    31433143        Source/WebCore/platform/mock/ScrollbarThemeMock.h \
    3144         Source/WebCore/platform/mock/SpeechInputClientMock.cpp \
    3145         Source/WebCore/platform/mock/SpeechInputClientMock.h \
    31463144        Source/WebCore/platform/network/AuthenticationChallengeBase.cpp \
    31473145        Source/WebCore/platform/network/AuthenticationChallengeBase.h \
  • trunk/Source/WebCore/Target.pri

    r106192 r106219  
    11071107    platform/mock/GeolocationClientMock.cpp \
    11081108    platform/mock/GeolocationServiceMock.cpp \
    1109     platform/mock/SpeechInputClientMock.cpp \
    11101109    platform/mock/ScrollbarThemeMock.cpp \
    11111110    platform/network/AuthenticationChallengeBase.cpp \
     
    21012100    platform/mock/GeolocationClientMock.cpp \
    21022101    platform/mock/GeolocationServiceMock.h \
    2103     platform/mock/SpeechInputClientMock.h \
    21042102    platform/mock/ScrollbarThemeMock.h \
    21052103    platform/graphics/BitmapImage.h \
  • trunk/Source/WebCore/WebCore.gypi

    r106217 r106219  
    38533853            'platform/mock/ScrollbarThemeMock.cpp',
    38543854            'platform/mock/ScrollbarThemeMock.h',
    3855             'platform/mock/SpeechInputClientMock.cpp',
    3856             'platform/mock/SpeechInputClientMock.h',
    38573855            'platform/network/AuthenticationChallengeBase.cpp',
    38583856            'platform/network/BlobData.cpp',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r106217 r106219  
    3262532625                                        >
    3262632626                                </File>
    32627                                 <File
    32628                                         RelativePath="..\platform\mock\SpeechInputClientMock.cpp"
    32629                                         >
    32630                                 </File>
    32631                                 <File
    32632                                         RelativePath="..\platform\mock\SpeechInputClientMock.h"
    32633                                         >
    32634                                 </File>
    3263532627                        </Filter>
    3263632628                </Filter>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r106217 r106219  
    17981798                750D029311D0E7F300BD1B27 /* RenderInputSpeech.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */; };
    17991799                750D029411D0E7F300BD1B27 /* RenderInputSpeech.h in Headers */ = {isa = PBXBuildFile; fileRef = 750D029211D0E7F300BD1B27 /* RenderInputSpeech.h */; };
    1800                 7535BC9412020CFF0037EC45 /* SpeechInputClientMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7535BC9212020CFF0037EC45 /* SpeechInputClientMock.cpp */; };
    1801                 7535BC9512020CFF0037EC45 /* SpeechInputClientMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 7535BC9312020CFF0037EC45 /* SpeechInputClientMock.h */; };
    18021800                754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */; };
    18031801                754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */; };
     
    86608658                750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderInputSpeech.cpp; sourceTree = "<group>"; };
    86618659                750D029211D0E7F300BD1B27 /* RenderInputSpeech.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderInputSpeech.h; sourceTree = "<group>"; };
    8662                 7535BC9212020CFF0037EC45 /* SpeechInputClientMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SpeechInputClientMock.cpp; path = mock/SpeechInputClientMock.cpp; sourceTree = "<group>"; };
    8663                 7535BC9312020CFF0037EC45 /* SpeechInputClientMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpeechInputClientMock.h; path = mock/SpeechInputClientMock.h; sourceTree = "<group>"; };
    86648660                754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; };
    86658661                754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
     
    1475014746                                0FE71403142170B800DB33BA /* ScrollbarThemeMock.cpp */,
    1475114747                                0FE71404142170B800DB33BA /* ScrollbarThemeMock.h */,
    14752                                 7535BC9212020CFF0037EC45 /* SpeechInputClientMock.cpp */,
    14753                                 7535BC9312020CFF0037EC45 /* SpeechInputClientMock.h */,
    1475414748                        );
    1475514749                        name = mock;
     
    2351723511                                7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */,
    2351823512                                7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */,
    23519                                 7535BC9512020CFF0037EC45 /* SpeechInputClientMock.h in Headers */,
    2352023513                                75415AFD12958D5E003AD669 /* SpeechInputEvent.h in Headers */,
    2352123514                                7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */,
     
    2657426567                                626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */,
    2657526568                                7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */,
    26576                                 7535BC9412020CFF0037EC45 /* SpeechInputClientMock.cpp in Sources */,
    2657726569                                75415C28129A9920003AD669 /* SpeechInputEvent.cpp in Sources */,
    2657826570                                758978EC127090D60076D5A9 /* SpeechInputResult.cpp in Sources */,
  • trunk/Source/WebKit/chromium/ChangeLog

    r106216 r106219  
     12012-01-26  Hans Wennborg  <hans@chromium.org>
     2
     3        Speech Input: move MockSpeechInputClient into Chromium DumpRenderTree implementation
     4        https://bugs.webkit.org/show_bug.cgi?id=77083
     5
     6        Reviewed by Darin Fisher.
     7
     8        Remove the WebSpeechInputControllerMock interface and proxy
     9        implementation. The mock is moving to the DumpRenderTree
     10        implementation instead, which removes the need to expose this
     11        interface in the WebKit API.
     12
     13        Also add a proper copy constructor for WebSpeechInputResult.
     14        The default one doesn't do a proper copy.
     15
     16        * WebKit.gyp:
     17        * public/WebSpeechInputControllerMock.h: Removed.
     18        * public/WebSpeechInputResult.h:
     19        (WebKit::WebSpeechInputResult::WebSpeechInputResult):
     20        (WebSpeechInputResult):
     21        * src/WebSpeechInputControllerMockImpl.cpp: Removed.
     22        * src/WebSpeechInputControllerMockImpl.h: Removed.
     23        * src/WebSpeechInputResult.cpp:
     24        (WebKit::WebSpeechInputResult::set):
     25        (WebKit):
     26
    1272012-01-29  Kent Tamura  <tkent@chromium.org>
    228
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r106044 r106219  
    246246                'public/WebSocketClient.h',
    247247                'public/WebSpeechInputController.h',
    248                 'public/WebSpeechInputControllerMock.h',
    249248                'public/WebSpeechInputListener.h',
    250249                'public/WebSpeechInputResult.h',
     
    643642                'src/WebSolidColorLayer.cpp',
    644643                'src/WebSolidColorLayerImpl.cpp',
    645                 'src/WebSpeechInputControllerMockImpl.cpp',
    646                 'src/WebSpeechInputControllerMockImpl.h',
    647644                'src/WebSpeechInputResult.cpp',
    648645                'src/WebStorageAreaImpl.cpp',
  • trunk/Source/WebKit/chromium/public/WebSpeechInputResult.h

    r101122 r106219  
    4343public:
    4444    WebSpeechInputResult() { }
     45    WebSpeechInputResult(const WebSpeechInputResult& other) { assign(other); }
    4546    ~WebSpeechInputResult() { reset(); }
    4647
    4748    WEBKIT_EXPORT void set(const WebString& utterance, double confidence);
     49    WEBKIT_EXPORT void assign(const WebSpeechInputResult& other);
    4850    WEBKIT_EXPORT void reset();
    4951
  • trunk/Source/WebKit/chromium/src/WebSpeechInputResult.cpp

    r97379 r106219  
    4949}
    5050
     51void WebSpeechInputResult::assign(const WebSpeechInputResult& other)
     52{
     53    m_private = WebCore::SpeechInputResult::create(*other.m_private.get());
     54}
     55
    5156WebSpeechInputResult::operator PassRefPtr<WebCore::SpeechInputResult>() const
    5257{
  • trunk/Tools/ChangeLog

    r106199 r106219  
     12012-01-26  Hans Wennborg  <hans@chromium.org>
     2
     3        Speech Input: move MockSpeechInputClient into Chromium DumpRenderTree implementation
     4        https://bugs.webkit.org/show_bug.cgi?id=77083
     5
     6        Reviewed by Darin Fisher.
     7
     8        Add MockWebSpeechInputController which provides a mock implementation
     9        of the WebSpeechInputController interface, and use that in
     10        DumpRenderTree.
     11
     12        * DumpRenderTree/DumpRenderTree.gypi:
     13        * DumpRenderTree/chromium/LayoutTestController.cpp:
     14        (LayoutTestController::addMockSpeechInputResult):
     15        * DumpRenderTree/chromium/LayoutTestController.h:
     16        ():
     17        * DumpRenderTree/chromium/MockWebSpeechInputController.cpp: Added.
     18        (MockWebSpeechInputController::create):
     19        (MockWebSpeechInputController::addMockRecognitionResult):
     20        (MockWebSpeechInputController::clearResults):
     21        (MockWebSpeechInputController::startRecognition):
     22        (MockWebSpeechInputController::cancelRecognition):
     23        (MockWebSpeechInputController::stopRecording):
     24        (MockWebSpeechInputController::MockWebSpeechInputController):
     25        (MockWebSpeechInputController::speechTaskFired):
     26        (MockWebSpeechInputController::SpeechTask::SpeechTask):
     27        (MockWebSpeechInputController::SpeechTask::stop):
     28        (MockWebSpeechInputController::SpeechTask::runIfValid):
     29        * DumpRenderTree/chromium/MockWebSpeechInputController.h: Added.
     30        (WebKit):
     31        (MockWebSpeechInputController):
     32        (MockWebSpeechInputController::taskList):
     33        (SpeechTask):
     34        * DumpRenderTree/chromium/TestShell.cpp:
     35        * DumpRenderTree/chromium/WebViewHost.cpp:
     36        (WebViewHost::speechInputController):
     37        * DumpRenderTree/chromium/WebViewHost.h:
     38        (WebKit):
     39        (WebViewHost::speechInputControllerMock):
     40        (WebViewHost):
     41        ():
     42
    1432012-01-29  Sheriff Bot  <webkit.review.bot@gmail.com>
    244
  • trunk/Tools/DumpRenderTree/DumpRenderTree.gypi

    r104764 r106219  
    2323            'chromium/MockSpellCheck.cpp',
    2424            'chromium/MockSpellCheck.h',
     25            'chromium/MockWebSpeechInputController.cpp',
     26            'chromium/MockWebSpeechInputController.h',
    2527            'chromium/NotificationPresenter.h',
    2628            'chromium/NotificationPresenter.cpp',
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp

    r105789 r106219  
    3434
    3535#include "DRTDevToolsAgent.h"
     36#include "MockWebSpeechInputController.h"
    3637#include "TestShell.h"
    3738#include "WebAnimationController.h"
     
    5657#include "WebSettings.h"
    5758#include "platform/WebSize.h"
    58 #include "WebSpeechInputControllerMock.h"
    5959#include "platform/WebURL.h"
    6060#include "WebView.h"
     
    19351935        return;
    19361936
    1937     if (WebSpeechInputControllerMock* controller = m_shell->webViewHost()->speechInputControllerMock())
     1937    if (MockWebSpeechInputController* controller = m_shell->webViewHost()->speechInputControllerMock())
    19381938        controller->addMockRecognitionResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble(), cppVariantToWebString(arguments[2]));
    19391939}
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h

    r105789 r106219  
    5353namespace WebKit {
    5454class WebGeolocationClientMock;
    55 class WebSpeechInputController;
    56 class WebSpeechInputControllerMock;
    57 class WebSpeechInputListener;
    5855}
    5956
     
    443440    void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
    444441
    445     WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
    446442    bool shouldDumpAsAudio() const { return m_dumpAsAudio; }
    447443    void setShouldDumpAsAudio(bool dumpAsAudio) { m_dumpAsAudio = dumpAsAudio; }
     
    700696    WebKit::WebURL m_userStyleSheetLocation;
    701697
    702     OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
    703 
    704698    // WAV audio data is stored here.
    705699    WebKit::WebArrayBufferView m_audioData;
  • trunk/Tools/DumpRenderTree/chromium/TestShell.cpp

    r105500 r106219  
    5353#include "WebSettings.h"
    5454#include "platform/WebSize.h"
    55 #include "WebSpeechInputControllerMock.h"
    5655#include "platform/WebString.h"
    5756#include "platform/WebURLRequest.h"
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r105789 r106219  
    3333
    3434#include "LayoutTestController.h"
     35#include "MockWebSpeechInputController.h"
    3536#include "TestNavigationController.h"
    3637#include "TestShell.h"
     
    5657#include "WebScreenInfo.h"
    5758#include "platform/WebSize.h"
    58 #include "WebSpeechInputControllerMock.h"
    5959#include "WebStorageNamespace.h"
    6060#include "WebTextCheckingCompletion.h"
     
    679679{
    680680    if (!m_speechInputControllerMock)
    681         m_speechInputControllerMock = adoptPtr(WebSpeechInputControllerMock::create(listener));
     681        m_speechInputControllerMock = MockWebSpeechInputController::create(listener);
    682682    return m_speechInputControllerMock.get();
    683683}
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.h

    r105789 r106219  
    4646
    4747class LayoutTestController;
     48class MockWebSpeechInputController;
    4849class SkCanvas;
    4950class TestShell;
     
    5859class WebSharedWorkerClient;
    5960class WebSpeechInputController;
    60 class WebSpeechInputControllerMock;
    6161class WebSpeechInputListener;
    6262class WebURL;
     
    109109    void clearContextMenuData();
    110110
    111     WebKit::WebSpeechInputControllerMock* speechInputControllerMock() { return m_speechInputControllerMock.get(); }
     111    MockWebSpeechInputController* speechInputControllerMock() { return m_speechInputControllerMock.get(); }
    112112
    113113#if ENABLE(POINTER_LOCK)
     
    383383
    384384    OwnPtr<WebKit::WebDeviceOrientationClientMock> m_deviceOrientationClientMock;
    385     OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
     385    OwnPtr<MockWebSpeechInputController> m_speechInputControllerMock;
    386386
    387387    OwnPtr<WebKit::WebUserMediaClientMock> m_userMediaClientMock;
Note: See TracChangeset for help on using the changeset viewer.