Home | History | Annotate | Download | only in testing
      1 /*
      2  * Copyright (C) 2012 Google Inc. All rights reserved.
      3  *
      4  * Redistribution and use in source and binary forms, with or without
      5  * modification, are permitted provided that the following conditions are
      6  * met:
      7  *
      8  *     * Redistributions of source code must retain the above copyright
      9  * notice, this list of conditions and the following disclaimer.
     10  *     * Redistributions in binary form must reproduce the above
     11  * copyright notice, this list of conditions and the following disclaimer
     12  * in the documentation and/or other materials provided with the
     13  * distribution.
     14  *     * Neither the name of Google Inc. nor the names of its
     15  * contributors may be used to endorse or promote products derived from
     16  * this software without specific prior written permission.
     17  *
     18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29  */
     30 
     31 #ifndef WebTestProxy_h
     32 #define WebTestProxy_h
     33 
     34 #include "WebScopedPtr.h"
     35 #include "WebTask.h"
     36 #include "WebTestCommon.h"
     37 #include "public/platform/WebNonCopyable.h"
     38 #include "public/platform/WebRect.h"
     39 #include "public/platform/WebURLError.h"
     40 #include "public/platform/WebURLRequest.h"
     41 #include "public/web/WebAXEnums.h"
     42 #include "public/web/WebDOMMessageEvent.h"
     43 #include "public/web/WebDataSource.h"
     44 #include "public/web/WebDragOperation.h"
     45 #include "public/web/WebIconURL.h"
     46 #include "public/web/WebNavigationPolicy.h"
     47 #include "public/web/WebNavigationType.h"
     48 #include "public/web/WebSecurityOrigin.h"
     49 #include "public/web/WebTextAffinity.h"
     50 #include "public/web/WebTextDirection.h"
     51 #include <map>
     52 #include <string>
     53 
     54 namespace blink {
     55 class WebAXObject;
     56 class WebAudioDevice;
     57 class WebCachedURLRequest;
     58 class WebColorChooser;
     59 class WebColorChooserClient;
     60 class WebDataSource;
     61 class WebDragData;
     62 class WebFileChooserCompletion;
     63 class WebFrame;
     64 class WebGeolocationClient;
     65 class WebGeolocationClientMock;
     66 class WebImage;
     67 class WebMIDIAccessor;
     68 class WebMIDIAccessorClient;
     69 class WebMIDIClient;
     70 class WebMIDIClientMock;
     71 class WebNode;
     72 class WebNotificationPresenter;
     73 class WebPlugin;
     74 class WebRange;
     75 class WebSerializedScriptValue;
     76 class WebSpeechInputController;
     77 class WebSpeechInputListener;
     78 class WebSpeechRecognizer;
     79 class WebSpellCheckClient;
     80 class WebString;
     81 class WebURL;
     82 class WebURLResponse;
     83 class WebUserMediaClient;
     84 class WebValidationMessageClient;
     85 class WebView;
     86 class WebWidget;
     87 struct WebColorSuggestion;
     88 struct WebConsoleMessage;
     89 struct WebContextMenuData;
     90 struct WebFileChooserParams;
     91 struct WebPluginParams;
     92 struct WebPoint;
     93 struct WebSize;
     94 struct WebWindowFeatures;
     95 typedef unsigned WebColor;
     96 }
     97 
     98 class SkCanvas;
     99 
    100 namespace WebTestRunner {
    101 
    102 class MockWebSpeechInputController;
    103 class MockWebSpeechRecognizer;
    104 class MockWebValidationMessageClient;
    105 class SpellCheckClient;
    106 class TestInterfaces;
    107 class WebTestDelegate;
    108 class WebTestInterfaces;
    109 class WebTestRunner;
    110 class WebUserMediaClientMock;
    111 
    112 class WEBTESTRUNNER_EXPORT WebTestProxyBase {
    113 public:
    114     void setInterfaces(WebTestInterfaces*);
    115     void setDelegate(WebTestDelegate*);
    116     void setWidget(blink::WebWidget*);
    117 
    118     void reset();
    119 
    120     blink::WebSpellCheckClient *spellCheckClient() const;
    121     blink::WebValidationMessageClient* validationMessageClient();
    122     blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient*, const blink::WebColor&);
    123     blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient*, const blink::WebColor&, const blink::WebVector<blink::WebColorSuggestion>& suggestions);
    124     bool runFileChooser(const blink::WebFileChooserParams&, blink::WebFileChooserCompletion*);
    125 
    126     std::string captureTree(bool debugRenderTree);
    127     SkCanvas* capturePixels();
    128 
    129     void setLogConsoleOutput(bool enabled);
    130 
    131     // FIXME: Make this private again.
    132     void scheduleComposite();
    133 
    134     void didOpenChooser();
    135     void didCloseChooser();
    136     bool isChooserShown();
    137 
    138 #if WEBTESTRUNNER_IMPLEMENTATION
    139     void display();
    140     void displayInvalidatedRegion();
    141     void discardBackingStore();
    142 
    143     blink::WebGeolocationClientMock* geolocationClientMock();
    144     blink::WebMIDIClientMock* midiClientMock();
    145     MockWebSpeechInputController* speechInputControllerMock();
    146     MockWebSpeechRecognizer* speechRecognizerMock();
    147 #endif
    148 
    149     WebTaskList* taskList() { return &m_taskList; }
    150 
    151     blink::WebView* webView();
    152 
    153     void didForceResize();
    154 
    155     void postSpellCheckEvent(const blink::WebString& eventName);
    156 
    157 protected:
    158     WebTestProxyBase();
    159     ~WebTestProxyBase();
    160 
    161     void didInvalidateRect(const blink::WebRect&);
    162     void didScrollRect(int, int, const blink::WebRect&);
    163     void scheduleAnimation();
    164     // FIXME: Remove once we switch to use didForceResize.
    165     void setWindowRect(const blink::WebRect&);
    166     void show(blink::WebNavigationPolicy);
    167     void didAutoResize(const blink::WebSize&);
    168     void postAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent);
    169     void startDragging(blink::WebFrame*, const blink::WebDragData&, blink::WebDragOperationsMask, const blink::WebImage&, const blink::WebPoint&);
    170     void didChangeSelection(bool isEmptySelection);
    171     void didChangeContents();
    172     void didEndEditing();
    173     bool createView(blink::WebFrame* creator, const blink::WebURLRequest&, const blink::WebWindowFeatures&, const blink::WebString& frameName, blink::WebNavigationPolicy, bool suppressOpener);
    174     blink::WebPlugin* createPlugin(blink::WebFrame*, const blink::WebPluginParams&);
    175     void setStatusText(const blink::WebString&);
    176     void didStopLoading();
    177     void showContextMenu(blink::WebFrame*, const blink::WebContextMenuData&);
    178     blink::WebUserMediaClient* userMediaClient();
    179     void printPage(blink::WebFrame*);
    180     blink::WebNotificationPresenter* notificationPresenter();
    181     blink::WebGeolocationClient* geolocationClient();
    182     blink::WebMIDIClient* webMIDIClient();
    183     blink::WebSpeechInputController* speechInputController(blink::WebSpeechInputListener*);
    184     blink::WebSpeechRecognizer* speechRecognizer();
    185     bool requestPointerLock();
    186     void requestPointerUnlock();
    187     bool isPointerLocked();
    188     void didFocus();
    189     void didBlur();
    190     void setToolTipText(const blink::WebString&, blink::WebTextDirection);
    191     void didAddMessageToConsole(const blink::WebConsoleMessage&, const blink::WebString& sourceName, unsigned sourceLine);
    192     void runModalAlertDialog(blink::WebFrame*, const blink::WebString&);
    193     bool runModalConfirmDialog(blink::WebFrame*, const blink::WebString&);
    194     bool runModalPromptDialog(blink::WebFrame*, const blink::WebString& message, const blink::WebString& defaultValue, blink::WebString* actualValue);
    195     bool runModalBeforeUnloadDialog(blink::WebFrame*, const blink::WebString&);
    196 
    197     void didStartProvisionalLoad(blink::WebFrame*);
    198     void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame*);
    199     bool didFailProvisionalLoad(blink::WebFrame*, const blink::WebURLError&);
    200     void didCommitProvisionalLoad(blink::WebFrame*, bool isNewNavigation);
    201     void didReceiveTitle(blink::WebFrame*, const blink::WebString& title, blink::WebTextDirection);
    202     void didChangeIcon(blink::WebFrame*, blink::WebIconURL::Type);
    203     void didFinishDocumentLoad(blink::WebFrame*);
    204     void didHandleOnloadEvents(blink::WebFrame*);
    205     void didFailLoad(blink::WebFrame*, const blink::WebURLError&);
    206     void didFinishLoad(blink::WebFrame*);
    207     void didChangeLocationWithinPage(blink::WebFrame*);
    208     void didDetectXSS(blink::WebFrame*, const blink::WebURL& insecureURL, bool didBlockEntirePage);
    209     void didDispatchPingLoader(blink::WebFrame*, const blink::WebURL&);
    210     void willRequestResource(blink::WebFrame*, const blink::WebCachedURLRequest&);
    211     void didCreateDataSource(blink::WebFrame*, blink::WebDataSource*);
    212     void willSendRequest(blink::WebFrame*, unsigned identifier, blink::WebURLRequest&, const blink::WebURLResponse& redirectResponse);
    213     void didReceiveResponse(blink::WebFrame*, unsigned identifier, const blink::WebURLResponse&);
    214     void didChangeResourcePriority(blink::WebFrame*, unsigned identifier, const blink::WebURLRequest::Priority&);
    215     void didFinishResourceLoad(blink::WebFrame*, unsigned identifier);
    216     blink::WebNavigationPolicy decidePolicyForNavigation(blink::WebFrame*, blink::WebDataSource::ExtraData*, const blink::WebURLRequest&, blink::WebNavigationType, blink::WebNavigationPolicy defaultPolicy, bool isRedirect);
    217     bool willCheckAndDispatchMessageEvent(blink::WebFrame* sourceFrame, blink::WebFrame* targetFrame, blink::WebSecurityOrigin target, blink::WebDOMMessageEvent);
    218     void resetInputMethod();
    219 
    220 private:
    221     template<class, typename, typename> friend class WebFrameTestProxy;
    222     void locationChangeDone(blink::WebFrame*);
    223     void paintRect(const blink::WebRect&);
    224     void paintInvalidatedRegion();
    225     void paintPagesWithBoundaries();
    226     SkCanvas* canvas();
    227     void displayRepaintMask();
    228     void invalidateAll();
    229     void animateNow();
    230 
    231     blink::WebWidget* webWidget();
    232 
    233     TestInterfaces* m_testInterfaces;
    234     WebTestDelegate* m_delegate;
    235     blink::WebWidget* m_webWidget;
    236 
    237     WebTaskList m_taskList;
    238 
    239     WebScopedPtr<SpellCheckClient> m_spellcheck;
    240     WebScopedPtr<WebUserMediaClientMock> m_userMediaClient;
    241 
    242     // Painting.
    243     WebScopedPtr<SkCanvas> m_canvas;
    244     blink::WebRect m_paintRect;
    245     bool m_isPainting;
    246     bool m_animateScheduled;
    247     std::map<unsigned, std::string> m_resourceIdentifierMap;
    248     std::map<unsigned, blink::WebURLRequest> m_requestMap;
    249 
    250     bool m_logConsoleOutput;
    251     int m_chooserCount;
    252 
    253     WebScopedPtr<blink::WebGeolocationClientMock> m_geolocationClient;
    254     WebScopedPtr<blink::WebMIDIClientMock> m_midiClient;
    255     WebScopedPtr<MockWebSpeechRecognizer> m_speechRecognizer;
    256     WebScopedPtr<MockWebSpeechInputController> m_speechInputController;
    257     WebScopedPtr<MockWebValidationMessageClient> m_validationMessageClient;
    258 
    259     // FIXME:: We want to move away from this pattern and mark classes
    260     // as Noncopyable, but this class is marked as WEBTESTRUNNER_EXPORT
    261     // while WebNonCopyable is not, so we cannot inherit from WebNonCopyable.
    262     // To overcome the problem, for now not inheriting from WebNonCopyable
    263     // but plan to fix it when we make the change of making WebNonCopyable
    264     // a macro rather than class. We will have a single way to mark all classes
    265     // as Noncopyable.
    266     // Tracked under: http://code.google.com/p/chromium/issues/detail?id=229178
    267 private:
    268     WebTestProxyBase(WebTestProxyBase&);
    269     WebTestProxyBase& operator=(const WebTestProxyBase&);
    270 };
    271 
    272 // Use this template to inject methods into your WebViewClient/WebFrameClient
    273 // implementation required for the running layout tests.
    274 template<class Base, typename T>
    275 class WebTestProxy : public Base, public WebTestProxyBase, public blink::WebNonCopyable {
    276 public:
    277     explicit WebTestProxy(T t)
    278         : Base(t)
    279     {
    280     }
    281 
    282     virtual ~WebTestProxy() { }
    283 
    284     // WebViewClient implementation.
    285     virtual void didInvalidateRect(const blink::WebRect& rect)
    286     {
    287         WebTestProxyBase::didInvalidateRect(rect);
    288     }
    289     virtual void didScrollRect(int dx, int dy, const blink::WebRect& clipRect)
    290     {
    291         WebTestProxyBase::didScrollRect(dx, dy, clipRect);
    292     }
    293     virtual void scheduleComposite()
    294     {
    295         WebTestProxyBase::scheduleComposite();
    296     }
    297     virtual void scheduleAnimation()
    298     {
    299         WebTestProxyBase::scheduleAnimation();
    300     }
    301     virtual void setWindowRect(const blink::WebRect& rect)
    302     {
    303         WebTestProxyBase::setWindowRect(rect);
    304         Base::setWindowRect(rect);
    305     }
    306     virtual void show(blink::WebNavigationPolicy policy)
    307     {
    308         WebTestProxyBase::show(policy);
    309         Base::show(policy);
    310     }
    311     virtual void didAutoResize(const blink::WebSize& newSize)
    312     {
    313         WebTestProxyBase::didAutoResize(newSize);
    314         Base::didAutoResize(newSize);
    315     }
    316     virtual void postAccessibilityEvent(const blink::WebAXObject& object, blink::WebAXEvent event)
    317     {
    318         WebTestProxyBase::postAccessibilityEvent(object, event);
    319         Base::postAccessibilityEvent(object, event);
    320     }
    321     virtual void startDragging(blink::WebFrame* frame, const blink::WebDragData& data, blink::WebDragOperationsMask mask, const blink::WebImage& image, const blink::WebPoint& point)
    322     {
    323         WebTestProxyBase::startDragging(frame, data, mask, image, point);
    324         // Don't forward this call to Base because we don't want to do a real drag-and-drop.
    325     }
    326     virtual void didChangeSelection(bool isEmptySelection)
    327     {
    328         WebTestProxyBase::didChangeSelection(isEmptySelection);
    329         Base::didChangeSelection(isEmptySelection);
    330     }
    331     virtual void didChangeContents()
    332     {
    333         WebTestProxyBase::didChangeContents();
    334         Base::didChangeContents();
    335     }
    336     virtual blink::WebView* createView(blink::WebFrame* creator, const blink::WebURLRequest& request, const blink::WebWindowFeatures& features, const blink::WebString& frameName, blink::WebNavigationPolicy policy, bool suppressOpener)
    337     {
    338         if (!WebTestProxyBase::createView(creator, request, features, frameName, policy, suppressOpener))
    339             return 0;
    340         return Base::createView(creator, request, features, frameName, policy, suppressOpener);
    341     }
    342     virtual void setStatusText(const blink::WebString& text)
    343     {
    344         WebTestProxyBase::setStatusText(text);
    345         Base::setStatusText(text);
    346     }
    347     virtual void didStopLoading()
    348     {
    349         WebTestProxyBase::didStopLoading();
    350         Base::didStopLoading();
    351     }
    352     virtual void showContextMenu(blink::WebFrame* frame, const blink::WebContextMenuData& contextMenuData)
    353     {
    354         WebTestProxyBase::showContextMenu(frame, contextMenuData);
    355         Base::showContextMenu(frame, contextMenuData);
    356     }
    357     virtual blink::WebUserMediaClient* userMediaClient()
    358     {
    359         return WebTestProxyBase::userMediaClient();
    360     }
    361     virtual void printPage(blink::WebFrame* frame)
    362     {
    363         WebTestProxyBase::printPage(frame);
    364     }
    365     virtual blink::WebNotificationPresenter* notificationPresenter()
    366     {
    367         return WebTestProxyBase::notificationPresenter();
    368     }
    369     virtual blink::WebGeolocationClient* geolocationClient()
    370     {
    371         return WebTestProxyBase::geolocationClient();
    372     }
    373     virtual blink::WebMIDIClient* webMIDIClient()
    374     {
    375         return WebTestProxyBase::webMIDIClient();
    376     }
    377     virtual blink::WebSpeechInputController* speechInputController(blink::WebSpeechInputListener* listener)
    378     {
    379         return WebTestProxyBase::speechInputController(listener);
    380     }
    381     virtual blink::WebSpeechRecognizer* speechRecognizer()
    382     {
    383         return WebTestProxyBase::speechRecognizer();
    384     }
    385     virtual bool requestPointerLock()
    386     {
    387         return WebTestProxyBase::requestPointerLock();
    388     }
    389     virtual void requestPointerUnlock()
    390     {
    391         WebTestProxyBase::requestPointerUnlock();
    392     }
    393     virtual bool isPointerLocked()
    394     {
    395         return WebTestProxyBase::isPointerLocked();
    396     }
    397     virtual void didFocus()
    398     {
    399         WebTestProxyBase::didFocus();
    400         Base::didFocus();
    401     }
    402     virtual void didBlur()
    403     {
    404         WebTestProxyBase::didBlur();
    405         Base::didBlur();
    406     }
    407     virtual void setToolTipText(const blink::WebString& text, blink::WebTextDirection hint)
    408     {
    409         WebTestProxyBase::setToolTipText(text, hint);
    410         Base::setToolTipText(text, hint);
    411     }
    412     virtual void resetInputMethod()
    413     {
    414         WebTestProxyBase::resetInputMethod();
    415     }
    416 
    417     virtual void didStartProvisionalLoad(blink::WebFrame* frame)
    418     {
    419         WebTestProxyBase::didStartProvisionalLoad(frame);
    420         Base::didStartProvisionalLoad(frame);
    421     }
    422     virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* frame)
    423     {
    424         WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad(frame);
    425         Base::didReceiveServerRedirectForProvisionalLoad(frame);
    426     }
    427     virtual void didFailProvisionalLoad(blink::WebFrame* frame, const blink::WebURLError& error)
    428     {
    429         // If the test finished, don't notify the embedder of the failed load,
    430         // as we already destroyed the document loader.
    431         if (WebTestProxyBase::didFailProvisionalLoad(frame, error))
    432             return;
    433         Base::didFailProvisionalLoad(frame, error);
    434     }
    435     virtual void didCommitProvisionalLoad(blink::WebFrame* frame, bool isNewNavigation)
    436     {
    437         WebTestProxyBase::didCommitProvisionalLoad(frame, isNewNavigation);
    438         Base::didCommitProvisionalLoad(frame, isNewNavigation);
    439     }
    440     virtual void didReceiveTitle(blink::WebFrame* frame, const blink::WebString& title, blink::WebTextDirection direction)
    441     {
    442         WebTestProxyBase::didReceiveTitle(frame, title, direction);
    443         Base::didReceiveTitle(frame, title, direction);
    444     }
    445     virtual void didChangeIcon(blink::WebFrame* frame, blink::WebIconURL::Type iconType)
    446     {
    447         WebTestProxyBase::didChangeIcon(frame, iconType);
    448         Base::didChangeIcon(frame, iconType);
    449     }
    450     virtual void didFinishDocumentLoad(blink::WebFrame* frame)
    451     {
    452         WebTestProxyBase::didFinishDocumentLoad(frame);
    453         Base::didFinishDocumentLoad(frame);
    454     }
    455     virtual void didHandleOnloadEvents(blink::WebFrame* frame)
    456     {
    457         WebTestProxyBase::didHandleOnloadEvents(frame);
    458         Base::didHandleOnloadEvents(frame);
    459     }
    460     virtual void didFailLoad(blink::WebFrame* frame, const blink::WebURLError& error)
    461     {
    462         WebTestProxyBase::didFailLoad(frame, error);
    463         Base::didFailLoad(frame, error);
    464     }
    465     virtual void didFinishLoad(blink::WebFrame* frame)
    466     {
    467         WebTestProxyBase::didFinishLoad(frame);
    468         Base::didFinishLoad(frame);
    469     }
    470     virtual void didDetectXSS(blink::WebFrame* frame, const blink::WebURL& insecureURL, bool didBlockEntirePage)
    471     {
    472         WebTestProxyBase::didDetectXSS(frame, insecureURL, didBlockEntirePage);
    473         Base::didDetectXSS(frame, insecureURL, didBlockEntirePage);
    474     }
    475     virtual void willRequestResource(blink::WebFrame* frame, const blink::WebCachedURLRequest& request)
    476     {
    477         WebTestProxyBase::willRequestResource(frame, request);
    478         Base::willRequestResource(frame, request);
    479     }
    480     virtual void didCreateDataSource(blink::WebFrame* frame, blink::WebDataSource* ds)
    481     {
    482         WebTestProxyBase::didCreateDataSource(frame, ds);
    483         Base::didCreateDataSource(frame, ds);
    484     }
    485     virtual void willSendRequest(blink::WebFrame* frame, unsigned identifier, blink::WebURLRequest& request, const blink::WebURLResponse& redirectResponse)
    486     {
    487         WebTestProxyBase::willSendRequest(frame, identifier, request, redirectResponse);
    488         Base::willSendRequest(frame, identifier, request, redirectResponse);
    489     }
    490     virtual void didReceiveResponse(blink::WebFrame* frame, unsigned identifier, const blink::WebURLResponse& response)
    491     {
    492         WebTestProxyBase::didReceiveResponse(frame, identifier, response);
    493         Base::didReceiveResponse(frame, identifier, response);
    494     }
    495     virtual void didChangeResourcePriority(blink::WebFrame* frame, unsigned identifier, const blink::WebURLRequest::Priority& priority)
    496     {
    497         WebTestProxyBase::didChangeResourcePriority(frame, identifier, priority);
    498         Base::didChangeResourcePriority(frame, identifier, priority);
    499     }
    500     virtual void didFinishResourceLoad(blink::WebFrame* frame, unsigned identifier)
    501     {
    502         WebTestProxyBase::didFinishResourceLoad(frame, identifier);
    503         Base::didFinishResourceLoad(frame, identifier);
    504     }
    505     virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, const blink::WebString& sourceName, unsigned sourceLine, const blink::WebString& stackTrace)
    506     {
    507         WebTestProxyBase::didAddMessageToConsole(message, sourceName, sourceLine);
    508         Base::didAddMessageToConsole(message, sourceName, sourceLine, stackTrace);
    509     }
    510     virtual void runModalAlertDialog(blink::WebFrame* frame, const blink::WebString& message)
    511     {
    512         WebTestProxyBase::runModalAlertDialog(frame, message);
    513         Base::runModalAlertDialog(frame, message);
    514     }
    515     virtual bool runModalConfirmDialog(blink::WebFrame* frame, const blink::WebString& message)
    516     {
    517         WebTestProxyBase::runModalConfirmDialog(frame, message);
    518         return Base::runModalConfirmDialog(frame, message);
    519     }
    520     virtual bool runModalPromptDialog(blink::WebFrame* frame, const blink::WebString& message, const blink::WebString& defaultValue, blink::WebString* actualValue)
    521     {
    522         WebTestProxyBase::runModalPromptDialog(frame, message, defaultValue, actualValue);
    523         return Base::runModalPromptDialog(frame, message, defaultValue, actualValue);
    524     }
    525     virtual bool runModalBeforeUnloadDialog(blink::WebFrame* frame, const blink::WebString& message)
    526     {
    527         return WebTestProxyBase::runModalBeforeUnloadDialog(frame, message);
    528     }
    529     virtual blink::WebNavigationPolicy decidePolicyForNavigation(blink::WebFrame* frame, blink::WebDataSource::ExtraData* extraData, const blink::WebURLRequest& request, blink::WebNavigationType type, blink::WebNavigationPolicy defaultPolicy, bool isRedirect)
    530     {
    531         blink::WebNavigationPolicy policy = WebTestProxyBase::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect);
    532         if (policy == blink::WebNavigationPolicyIgnore)
    533             return policy;
    534         return Base::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect);
    535     }
    536     virtual bool willCheckAndDispatchMessageEvent(blink::WebFrame* sourceFrame, blink::WebFrame* targetFrame, blink::WebSecurityOrigin target, blink::WebDOMMessageEvent event)
    537     {
    538         if (WebTestProxyBase::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event))
    539             return true;
    540         return Base::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event);
    541     }
    542     virtual blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient* client, const blink::WebColor& color)
    543     {
    544         return WebTestProxyBase::createColorChooser(client, color);
    545     }
    546     virtual blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient* client, const blink::WebColor& color, const blink::WebVector<blink::WebColorSuggestion>& suggestions)
    547     {
    548         return WebTestProxyBase::createColorChooser(client, color, suggestions);
    549     }
    550     virtual bool runFileChooser(const blink::WebFileChooserParams& params, blink::WebFileChooserCompletion* completion)
    551     {
    552         return WebTestProxyBase::runFileChooser(params, completion);
    553     }
    554     virtual void postSpellCheckEvent(const blink::WebString& eventName)
    555     {
    556         WebTestProxyBase::postSpellCheckEvent(eventName);
    557     }
    558 };
    559 
    560 }
    561 
    562 #endif // WebTestProxy_h
    563