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