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