Changeset 139090 in webkit
- Timestamp:
- Jan 8, 2013 11:49:34 AM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r139088 r139090 1 2013-01-08 Jochen Eisinger <jochen@chromium.org> 2 3 [chromium] move dumpFrameLoadCallbacks and friends to the TestRunner library 4 https://bugs.webkit.org/show_bug.cgi?id=106324 5 6 Reviewed by Adam Barth. 7 8 Since the frame load callbacks are part of the WebFrameClient, the 9 WebTestProxy is now intercepting both WebViewClient and WebFrameClient 10 methods. 11 12 * DumpRenderTree/chromium/DRTTestRunner.cpp: 13 (DRTTestRunner::DRTTestRunner): 14 (DRTTestRunner::reset): 15 * DumpRenderTree/chromium/DRTTestRunner.h: 16 (DRTTestRunner): 17 * DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h: 18 (WebTestInterfaces): 19 * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h: 20 (WebKit): 21 (WebTestProxyBase): 22 (WebTestRunner): 23 (WebTestRunner::WebTestProxy::WebTestProxy): 24 (WebTestProxy): 25 (WebTestRunner::WebTestProxy::didInvalidateRect): 26 (WebTestRunner::WebTestProxy::didScrollRect): 27 (WebTestRunner::WebTestProxy::scheduleComposite): 28 (WebTestRunner::WebTestProxy::scheduleAnimation): 29 (WebTestRunner::WebTestProxy::setWindowRect): 30 (WebTestRunner::WebTestProxy::show): 31 (WebTestRunner::WebTestProxy::didAutoResize): 32 (WebTestRunner::WebTestProxy::postAccessibilityNotification): 33 (WebTestRunner::WebTestProxy::startDragging): 34 (WebTestRunner::WebTestProxy::shouldBeginEditing): 35 (WebTestRunner::WebTestProxy::shouldEndEditing): 36 (WebTestRunner::WebTestProxy::shouldInsertNode): 37 (WebTestRunner::WebTestProxy::shouldInsertText): 38 (WebTestRunner::WebTestProxy::shouldChangeSelectedRange): 39 (WebTestRunner::WebTestProxy::shouldDeleteRange): 40 (WebTestRunner::WebTestProxy::shouldApplyStyle): 41 (WebTestRunner::WebTestProxy::didBeginEditing): 42 (WebTestRunner::WebTestProxy::didChangeSelection): 43 (WebTestRunner::WebTestProxy::didChangeContents): 44 (WebTestRunner::WebTestProxy::didEndEditing): 45 (WebTestRunner::WebTestProxy::registerIntentService): 46 (WebTestRunner::WebTestProxy::dispatchIntent): 47 (WebTestRunner::WebTestProxy::willPerformClientRedirect): 48 (WebTestRunner::WebTestProxy::didCancelClientRedirect): 49 (WebTestRunner::WebTestProxy::didStartProvisionalLoad): 50 (WebTestRunner::WebTestProxy::didReceiveServerRedirectForProvisionalLoad): 51 (WebTestRunner::WebTestProxy::didFailProvisionalLoad): 52 (WebTestRunner::WebTestProxy::didCommitProvisionalLoad): 53 (WebTestRunner::WebTestProxy::didReceiveTitle): 54 (WebTestRunner::WebTestProxy::didFinishDocumentLoad): 55 (WebTestRunner::WebTestProxy::didHandleOnloadEvents): 56 (WebTestRunner::WebTestProxy::didFailLoad): 57 (WebTestRunner::WebTestProxy::didFinishLoad): 58 (WebTestRunner::WebTestProxy::didChangeLocationWithinPage): 59 (WebTestRunner::WebTestProxy::didDisplayInsecureContent): 60 (WebTestRunner::WebTestProxy::didRunInsecureContent): 61 (WebTestRunner::WebTestProxy::didDetectXSS): 62 * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h: 63 (WebTestRunner::WebTestRunner::setTestIsRunning): 64 (WebTestRunner::WebTestRunner::shouldDumpFrameLoadCallbacks): 65 (WebTestRunner::WebTestRunner::setShouldDumpFrameLoadCallbacks): 66 (WebTestRunner::WebTestRunner::shouldDumpUserGestureInFrameLoadCallbacks): 67 (WebTestRunner::WebTestRunner::stopProvisionalFrameLoads): 68 (WebTestRunner::WebTestRunner::shouldDumpTitleChanges): 69 * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: 70 (WebTestRunner::TestRunner::TestRunner): 71 (WebTestRunner::TestRunner::reset): 72 (WebTestRunner::TestRunner::setTestIsRunning): 73 (WebTestRunner): 74 (WebTestRunner::TestRunner::shouldDumpFrameLoadCallbacks): 75 (WebTestRunner::TestRunner::setShouldDumpFrameLoadCallbacks): 76 (WebTestRunner::TestRunner::shouldDumpUserGestureInFrameLoadCallbacks): 77 (WebTestRunner::TestRunner::stopProvisionalFrameLoads): 78 (WebTestRunner::TestRunner::shouldDumpTitleChanges): 79 (WebTestRunner::TestRunner::dumpFrameLoadCallbacks): 80 (WebTestRunner::TestRunner::dumpUserGestureInFrameLoadCallbacks): 81 (WebTestRunner::TestRunner::setStopProvisionalFrameLoads): 82 (WebTestRunner::TestRunner::dumpTitleChanges): 83 * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: 84 (TestRunner): 85 * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp: 86 (WebTestInterfaces::Internal): 87 (WebTestRunner::WebTestInterfaces::Internal::webView): 88 (WebTestRunner::WebTestInterfaces::Internal::Internal): 89 (WebTestRunner::WebTestInterfaces::Internal::setWebView): 90 (WebTestRunner): 91 (WebTestRunner::WebTestInterfaces::Internal::setTestIsRunning): 92 (WebTestRunner::WebTestInterfaces::setWebView): 93 (WebTestRunner::WebTestInterfaces::setTestIsRunning): 94 (WebTestRunner::WebTestInterfaces::webView): 95 * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp: 96 (WebTestRunner::WebTestProxyBase::willPerformClientRedirect): 97 (WebTestRunner): 98 (WebTestRunner::WebTestProxyBase::didCancelClientRedirect): 99 (WebTestRunner::WebTestProxyBase::didStartProvisionalLoad): 100 (WebTestRunner::WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad): 101 (WebTestRunner::WebTestProxyBase::didFailProvisionalLoad): 102 (WebTestRunner::WebTestProxyBase::didCommitProvisionalLoad): 103 (WebTestRunner::WebTestProxyBase::didReceiveTitle): 104 (WebTestRunner::WebTestProxyBase::didFinishDocumentLoad): 105 (WebTestRunner::WebTestProxyBase::didHandleOnloadEvents): 106 (WebTestRunner::WebTestProxyBase::didFailLoad): 107 (WebTestRunner::WebTestProxyBase::didFinishLoad): 108 (WebTestRunner::WebTestProxyBase::didChangeLocationWithinPage): 109 (WebTestRunner::WebTestProxyBase::didDisplayInsecureContent): 110 (WebTestRunner::WebTestProxyBase::didRunInsecureContent): 111 (WebTestRunner::WebTestProxyBase::didDetectXSS): 112 * DumpRenderTree/chromium/TestShell.cpp: 113 (TestShell::runFileTest): 114 (TestShell::testFinished): 115 * DumpRenderTree/chromium/TestShell.h: 116 (TestShell): 117 * DumpRenderTree/chromium/WebViewHost.cpp: 118 (WebViewHost::didStartProvisionalLoad): 119 (WebViewHost::didReceiveServerRedirectForProvisionalLoad): 120 (WebViewHost::didFailProvisionalLoad): 121 (WebViewHost::didCommitProvisionalLoad): 122 (WebViewHost::didReceiveTitle): 123 (WebViewHost::didFailLoad): 124 (WebViewHost::didFinishLoad): 125 * DumpRenderTree/chromium/WebViewHost.h: 126 (WebViewHost): 127 1 128 2013-01-08 Zan Dobersek <zandobersek@gmail.com> 2 129 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
r138993 r139090 119 119 bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion); 120 120 bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList); 121 bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks);122 121 bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback); 123 bindMethod("dumpUserGestureInFrameLoadCallbacks", &DRTTestRunner::dumpUserGestureInFrameLoadCallbacks);124 122 bindMethod("dumpResourceLoadCallbacks", &DRTTestRunner::dumpResourceLoadCallbacks); 125 123 bindMethod("dumpResourceRequestCallbacks", &DRTTestRunner::dumpResourceRequestCallbacks); … … 127 125 bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect); 128 126 bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges); 129 bindMethod("dumpTitleChanges", &DRTTestRunner::dumpTitleChanges);130 127 bindMethod("dumpPermissionClientCallbacks", &DRTTestRunner::dumpPermissionClientCallbacks); 131 128 bindMethod("dumpCreateView", &DRTTestRunner::dumpCreateView); … … 167 164 bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor); 168 165 bindMethod("setSmartInsertDeleteEnabled", &DRTTestRunner::setSmartInsertDeleteEnabled); 169 bindMethod("setStopProvisionalFrameLoads", &DRTTestRunner::setStopProvisionalFrameLoads);170 166 bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader); 171 167 bindMethod("setWillSendRequestReturnsNull", &DRTTestRunner::setWillSendRequestReturnsNull); … … 252 248 } 253 249 254 void DRTTestRunner::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)255 {256 m_dumpFrameLoadCallbacks = true;257 result->setNull();258 }259 260 250 void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result) 261 251 { … … 264 254 } 265 255 266 void DRTTestRunner::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)267 {268 m_dumpUserGestureInFrameLoadCallbacks = true;269 result->setNull();270 }271 272 256 void DRTTestRunner::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result) 273 257 { … … 291 275 { 292 276 m_dumpWindowStatusChanges = true; 293 result->setNull();294 }295 296 void DRTTestRunner::dumpTitleChanges(const CppArgumentList&, CppVariant* result)297 {298 m_dumpTitleChanges = true;299 277 result->setNull(); 300 278 } … … 497 475 m_shell->webViewHost()->setDeviceScaleFactor(1); 498 476 m_dumpCreateView = false; 499 m_dumpFrameLoadCallbacks = false;500 477 m_dumpProgressFinishedCallback = false; 501 m_dumpUserGestureInFrameLoadCallbacks = false;502 478 m_dumpResourceLoadCallbacks = false; 503 479 m_dumpResourceRequestCallbacks = false; … … 506 482 m_dumpWindowStatusChanges = false; 507 483 m_dumpSelectionRect = false; 508 m_dumpTitleChanges = false;509 484 m_dumpPermissionClientCallbacks = false; 510 485 m_waitUntilDone = false; … … 512 487 m_testRepaint = false; 513 488 m_sweepHorizontally = false; 514 m_stopProvisionalFrameLoads = false;515 489 m_deferMainResourceDataLoad = true; 516 490 m_webHistoryItemCount.set(0); … … 706 680 } 707 681 708 void DRTTestRunner::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result)709 {710 result->setNull();711 m_stopProvisionalFrameLoads = true;712 }713 714 682 void DRTTestRunner::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result) 715 683 { -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h
r138993 r139090 77 77 78 78 // This function sets a flag that tells the test_shell to print a line of 79 // descriptive text for each frame load callback. It takes no arguments, and80 // ignores any that may be present.81 void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);82 83 // This function sets a flag that tells the test_shell to print a line of84 79 // descriptive text for the progress finished callback. It takes no 85 80 // arguments, and ignores any that may be present. 86 81 void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*); 87 88 // This function sets a flag that tells the test_shell to print a line of89 // user gesture status text for some frame load callbacks. It takes no90 // arguments, and ignores any that may be present.91 void dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant*);92 82 93 83 // This function sets a flag that tells the test_shell to print out a text … … 171 161 void pathToLocalResource(const CppArgumentList&, CppVariant*); 172 162 173 // If true, causes provisional frame loads to be stopped for the remainder of174 // the test.175 void setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant*);176 177 163 // Enable or disable smart insert/delete. This is enabled by default. 178 164 void setSmartInsertDeleteEnabled(const CppArgumentList&, CppVariant*); … … 193 179 void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*); 194 180 195 void dumpTitleChanges(const CppArgumentList&, CppVariant*);196 181 void display(const CppArgumentList&, CppVariant*); 197 182 void displayInvalidatedRegion(const CppArgumentList&, CppVariant*); … … 263 248 void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); } 264 249 265 bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }266 void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }267 250 bool shouldDumpProgressFinishedCallback() { return m_dumpProgressFinishedCallback; } 268 251 void setShouldDumpProgressFinishedCallback(bool value) { m_dumpProgressFinishedCallback = value; } 269 bool shouldDumpUserGestureInFrameLoadCallbacks() { return m_dumpUserGestureInFrameLoadCallbacks; }270 void setShouldDumpUserGestureInFrameLoadCallbacks(bool value) { m_dumpUserGestureInFrameLoadCallbacks = value; }271 252 bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; } 272 253 void setShouldDumpResourceRequestCallbacks(bool value) { m_dumpResourceRequestCallbacks = value; } … … 277 258 bool shouldDumpSelectionRect() { return m_dumpSelectionRect; } 278 259 bool shouldDumpBackForwardList() { return m_dumpBackForwardList; } 279 bool shouldDumpTitleChanges() { return m_dumpTitleChanges; }280 260 bool shouldDumpPermissionClientCallbacks() { return m_dumpPermissionClientCallbacks; } 281 261 bool shouldDumpCreateView() { return m_dumpCreateView; } 282 262 bool canOpenWindows() { return m_canOpenWindows; } 283 bool stopProvisionalFrameLoads() { return m_stopProvisionalFrameLoads; }284 263 bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; } 285 264 void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; } … … 375 354 bool m_dumpSelectionRect; 376 355 377 // If true, the test_shell will output a descriptive line for each frame378 // load callback.379 bool m_dumpFrameLoadCallbacks;380 381 356 // If true, the test_shell will output a descriptive line for the progress 382 357 // finished callback. 383 358 bool m_dumpProgressFinishedCallback; 384 359 385 // If true, the test_shell will output a line of the user gesture status386 // text for some frame load callbacks.387 bool m_dumpUserGestureInFrameLoadCallbacks;388 389 360 // If true, the test_shell will output a descriptive line for each resource 390 361 // load callback. … … 405 376 // If true, the test_shell will dump all changes to window.status. 406 377 bool m_dumpWindowStatusChanges; 407 408 // If true, output a message when the page title is changed.409 bool m_dumpTitleChanges;410 378 411 379 // If true, output a descriptive line each time a permission client … … 434 402 bool m_sweepHorizontally; 435 403 436 // If true, stops provisional frame loads during the437 // DidStartProvisionalLoadForFrame callback.438 bool m_stopProvisionalFrameLoads;439 440 404 // If true, don't dump output until notifyDone is called. 441 405 bool m_waitUntilDone; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h
r137993 r139090 53 53 void bindTo(WebKit::WebFrame*); 54 54 void resetAll(); 55 void setTestIsRunning(bool); 55 56 57 WebKit::WebView* webView() const; 56 58 WebAccessibilityController* accessibilityController(); 57 59 WebEventSender* eventSender(); -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h
r137997 r139090 38 38 #include "WebKit/chromium/public/WebNavigationPolicy.h" 39 39 #include "WebKit/chromium/public/WebTextAffinity.h" 40 #include "WebKit/chromium/public/WebTextDirection.h" 40 41 41 42 namespace WebKit { … … 48 49 class WebNode; 49 50 class WebRange; 51 class WebSecurityOrigin; 52 class WebSerializedScriptValue; 50 53 class WebString; 54 class WebURL; 51 55 struct WebPoint; 52 class WebSerializedScriptValue;53 56 struct WebSize; 57 struct WebURLError; 54 58 } 55 59 … … 94 98 void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&); 95 99 void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest&); 100 void willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time); 101 void didCancelClientRedirect(WebKit::WebFrame*); 102 void didStartProvisionalLoad(WebKit::WebFrame*); 103 void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame*); 104 void didFailProvisionalLoad(WebKit::WebFrame*, const WebKit::WebURLError&); 105 void didCommitProvisionalLoad(WebKit::WebFrame*, bool isNewNavigation); 106 void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString& title, WebKit::WebTextDirection); 107 void didFinishDocumentLoad(WebKit::WebFrame*); 108 void didHandleOnloadEvents(WebKit::WebFrame*); 109 void didFailLoad(WebKit::WebFrame*, const WebKit::WebURLError&); 110 void didFinishLoad(WebKit::WebFrame*); 111 void didChangeLocationWithinPage(WebKit::WebFrame*); 112 void didDisplayInsecureContent(WebKit::WebFrame*); 113 void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL& insecureURL); 114 void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL& insecureURL, bool didBlockEntirePage); 96 115 97 116 private: … … 102 121 }; 103 122 104 // Use this template to inject methods into your WebViewClient implementation105 // required for the running layout tests.106 template<class WebViewClientImpl, typename T>107 class WebTestProxy : public WebViewClientImpl, public WebTestProxyBase {123 // Use this template to inject methods into your WebViewClient/WebFrameClient 124 // implementation required for the running layout tests. 125 template<class Base, typename T> 126 class WebTestProxy : public Base, public WebTestProxyBase { 108 127 public: 109 128 explicit WebTestProxy(T t) 110 : WebViewClientImpl(t)129 : Base(t) 111 130 { 112 131 } … … 114 133 virtual ~WebTestProxy() { } 115 134 135 // WebViewClient implementation. 116 136 virtual void didInvalidateRect(const WebKit::WebRect& rect) 117 137 { 118 138 WebTestProxyBase::didInvalidateRect(rect); 119 WebViewClientImpl::didInvalidateRect(rect);139 Base::didInvalidateRect(rect); 120 140 } 121 141 virtual void didScrollRect(int dx, int dy, const WebKit::WebRect& clipRect) 122 142 { 123 143 WebTestProxyBase::didScrollRect(dx, dy, clipRect); 124 WebViewClientImpl::didScrollRect(dx, dy, clipRect);144 Base::didScrollRect(dx, dy, clipRect); 125 145 } 126 146 virtual void scheduleComposite() 127 147 { 128 148 WebTestProxyBase::scheduleComposite(); 129 WebViewClientImpl::scheduleComposite();149 Base::scheduleComposite(); 130 150 } 131 151 virtual void scheduleAnimation() 132 152 { 133 153 WebTestProxyBase::scheduleAnimation(); 134 WebViewClientImpl::scheduleAnimation();154 Base::scheduleAnimation(); 135 155 } 136 156 virtual void setWindowRect(const WebKit::WebRect& rect) 137 157 { 138 158 WebTestProxyBase::setWindowRect(rect); 139 WebViewClientImpl::setWindowRect(rect);159 Base::setWindowRect(rect); 140 160 } 141 161 virtual void show(WebKit::WebNavigationPolicy policy) 142 162 { 143 163 WebTestProxyBase::show(policy); 144 WebViewClientImpl::show(policy);164 Base::show(policy); 145 165 } 146 166 virtual void didAutoResize(const WebKit::WebSize& newSize) 147 167 { 148 168 WebTestProxyBase::didAutoResize(newSize); 149 WebViewClientImpl::didAutoResize(newSize);169 Base::didAutoResize(newSize); 150 170 } 151 171 virtual void postAccessibilityNotification(const WebKit::WebAccessibilityObject& object, WebKit::WebAccessibilityNotification notification) 152 172 { 153 173 WebTestProxyBase::postAccessibilityNotification(object, notification); 154 WebViewClientImpl::postAccessibilityNotification(object, notification);174 Base::postAccessibilityNotification(object, notification); 155 175 } 156 176 virtual void startDragging(WebKit::WebFrame* frame, const WebKit::WebDragData& data, WebKit::WebDragOperationsMask mask, const WebKit::WebImage& image, const WebKit::WebPoint& point) 157 177 { 158 178 WebTestProxyBase::startDragging(frame, data, mask, image, point); 159 WebViewClientImpl::startDragging(frame, data, mask, image, point);179 Base::startDragging(frame, data, mask, image, point); 160 180 } 161 181 virtual bool shouldBeginEditing(const WebKit::WebRange& range) 162 182 { 163 183 WebTestProxyBase::shouldBeginEditing(range); 164 return WebViewClientImpl::shouldBeginEditing(range);184 return Base::shouldBeginEditing(range); 165 185 } 166 186 virtual bool shouldEndEditing(const WebKit::WebRange& range) 167 187 { 168 188 WebTestProxyBase::shouldEndEditing(range); 169 return WebViewClientImpl::shouldEndEditing(range);189 return Base::shouldEndEditing(range); 170 190 } 171 191 virtual bool shouldInsertNode(const WebKit::WebNode& node, const WebKit::WebRange& range, WebKit::WebEditingAction action) 172 192 { 173 193 WebTestProxyBase::shouldInsertNode(node, range, action); 174 return WebViewClientImpl::shouldInsertNode(node, range, action);194 return Base::shouldInsertNode(node, range, action); 175 195 } 176 196 virtual bool shouldInsertText(const WebKit::WebString& text, const WebKit::WebRange& range, WebKit::WebEditingAction action) 177 197 { 178 198 WebTestProxyBase::shouldInsertText(text, range, action); 179 return WebViewClientImpl::shouldInsertText(text, range, action);199 return Base::shouldInsertText(text, range, action); 180 200 } 181 201 virtual bool shouldChangeSelectedRange(const WebKit::WebRange& fromRange, const WebKit::WebRange& toRange, WebKit::WebTextAffinity affinity, bool stillSelecting) 182 202 { 183 203 WebTestProxyBase::shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting); 184 return WebViewClientImpl::shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting);204 return Base::shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting); 185 205 } 186 206 virtual bool shouldDeleteRange(const WebKit::WebRange& range) 187 207 { 188 208 WebTestProxyBase::shouldDeleteRange(range); 189 return WebViewClientImpl::shouldDeleteRange(range);209 return Base::shouldDeleteRange(range); 190 210 } 191 211 virtual bool shouldApplyStyle(const WebKit::WebString& style, const WebKit::WebRange& range) 192 212 { 193 213 WebTestProxyBase::shouldApplyStyle(style, range); 194 return WebViewClientImpl::shouldApplyStyle(style, range);214 return Base::shouldApplyStyle(style, range); 195 215 } 196 216 virtual void didBeginEditing() 197 217 { 198 218 WebTestProxyBase::didBeginEditing(); 199 WebViewClientImpl::didBeginEditing();219 Base::didBeginEditing(); 200 220 } 201 221 virtual void didChangeSelection(bool isEmptySelection) 202 222 { 203 223 WebTestProxyBase::didChangeSelection(isEmptySelection); 204 WebViewClientImpl::didChangeSelection(isEmptySelection);224 Base::didChangeSelection(isEmptySelection); 205 225 } 206 226 virtual void didChangeContents() 207 227 { 208 228 WebTestProxyBase::didChangeContents(); 209 WebViewClientImpl::didChangeContents();229 Base::didChangeContents(); 210 230 } 211 231 virtual void didEndEditing() 212 232 { 213 233 WebTestProxyBase::didEndEditing(); 214 WebViewClientImpl::didEndEditing();234 Base::didEndEditing(); 215 235 } 216 236 virtual void registerIntentService(WebKit::WebFrame* frame, const WebKit::WebIntentServiceInfo& service) 217 237 { 218 238 WebTestProxyBase::registerIntentService(frame, service); 219 WebViewClientImpl::registerIntentService(frame, service);239 Base::registerIntentService(frame, service); 220 240 } 221 241 virtual void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest& request) 222 242 { 223 243 WebTestProxyBase::dispatchIntent(source, request); 224 WebViewClientImpl::dispatchIntent(source, request); 244 Base::dispatchIntent(source, request); 245 } 246 247 // WebFrameClient implementation. 248 virtual void willPerformClientRedirect(WebKit::WebFrame* frame, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fireTime) 249 { 250 WebTestProxyBase::willPerformClientRedirect(frame, from, to, interval, fireTime); 251 Base::willPerformClientRedirect(frame, from, to, interval, fireTime); 252 } 253 virtual void didCancelClientRedirect(WebKit::WebFrame* frame) 254 { 255 WebTestProxyBase::didCancelClientRedirect(frame); 256 Base::didCancelClientRedirect(frame); 257 } 258 virtual void didStartProvisionalLoad(WebKit::WebFrame* frame) 259 { 260 WebTestProxyBase::didStartProvisionalLoad(frame); 261 Base::didStartProvisionalLoad(frame); 262 } 263 virtual void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame* frame) 264 { 265 WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad(frame); 266 Base::didReceiveServerRedirectForProvisionalLoad(frame); 267 } 268 virtual void didFailProvisionalLoad(WebKit::WebFrame* frame, const WebKit::WebURLError& error) 269 { 270 WebTestProxyBase::didFailProvisionalLoad(frame, error); 271 Base::didFailProvisionalLoad(frame, error); 272 } 273 virtual void didCommitProvisionalLoad(WebKit::WebFrame* frame, bool isNewNavigation) 274 { 275 WebTestProxyBase::didCommitProvisionalLoad(frame, isNewNavigation); 276 Base::didCommitProvisionalLoad(frame, isNewNavigation); 277 } 278 virtual void didReceiveTitle(WebKit::WebFrame* frame, const WebKit::WebString& title, WebKit::WebTextDirection direction) 279 { 280 WebTestProxyBase::didReceiveTitle(frame, title, direction); 281 Base::didReceiveTitle(frame, title, direction); 282 } 283 virtual void didFinishDocumentLoad(WebKit::WebFrame* frame) 284 { 285 WebTestProxyBase::didFinishDocumentLoad(frame); 286 Base::didFinishDocumentLoad(frame); 287 } 288 virtual void didHandleOnloadEvents(WebKit::WebFrame* frame) 289 { 290 WebTestProxyBase::didHandleOnloadEvents(frame); 291 Base::didHandleOnloadEvents(frame); 292 } 293 virtual void didFailLoad(WebKit::WebFrame* frame, const WebKit::WebURLError& error) 294 { 295 WebTestProxyBase::didFailLoad(frame, error); 296 Base::didFailLoad(frame, error); 297 } 298 virtual void didFinishLoad(WebKit::WebFrame* frame) 299 { 300 WebTestProxyBase::didFinishLoad(frame); 301 Base::didFinishLoad(frame); 302 } 303 virtual void didChangeLocationWithinPage(WebKit::WebFrame* frame) 304 { 305 WebTestProxyBase::didChangeLocationWithinPage(frame); 306 Base::didChangeLocationWithinPage(frame); 307 } 308 virtual void didDisplayInsecureContent(WebKit::WebFrame* frame) 309 { 310 WebTestProxyBase::didDisplayInsecureContent(frame); 311 Base::didDisplayInsecureContent(frame); 312 } 313 virtual void didRunInsecureContent(WebKit::WebFrame* frame, const WebKit::WebSecurityOrigin& origin, const WebKit::WebURL& insecureURL) 314 { 315 WebTestProxyBase::didRunInsecureContent(frame, origin, insecureURL); 316 Base::didRunInsecureContent(frame, origin, insecureURL); 317 } 318 virtual void didDetectXSS(WebKit::WebFrame* frame, const WebKit::WebURL& insecureURL, bool didBlockEntirePage) 319 { 320 WebTestProxyBase::didDetectXSS(frame, insecureURL, didBlockEntirePage); 321 Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); 225 322 } 226 323 }; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h
r138993 r139090 42 42 class WebTestRunner { 43 43 public: 44 virtual void setTestIsRunning(bool) { } 44 45 virtual bool shouldDumpEditingCallbacks() const { return false; } 45 46 virtual bool shouldDumpAsText() const { return false; } … … 51 52 virtual bool shouldDumpAsAudio() const { return false; } 52 53 virtual const WebKit::WebArrayBufferView* audioData() const { return 0; } 54 virtual bool shouldDumpFrameLoadCallbacks() const { return false; } 55 virtual void setShouldDumpFrameLoadCallbacks(bool) { } 56 virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const { return false; } 57 virtual bool stopProvisionalFrameLoads() const { return false; } 58 virtual bool shouldDumpTitleChanges() const { return false; } 53 59 }; 54 60 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
r138993 r139090 79 79 80 80 TestRunner::TestRunner() 81 : m_delegate(0) 81 : m_testIsRunning(false) 82 , m_delegate(0) 82 83 , m_webView(0) 83 84 , m_intentClient(adoptPtr(new EmptyWebDeliveredIntentClient)) … … 138 139 bindMethod("dumpChildFrameScrollPositions", &TestRunner::dumpChildFrameScrollPositions); 139 140 bindMethod("setAudioData", &TestRunner::setAudioData); 141 bindMethod("dumpFrameLoadCallbacks", &TestRunner::dumpFrameLoadCallbacks); 142 bindMethod("dumpUserGestureInFrameLoadCallbacks", &TestRunner::dumpUserGestureInFrameLoadCallbacks); 143 bindMethod("setStopProvisionalFrameLoads", &TestRunner::setStopProvisionalFrameLoads); 144 bindMethod("dumpTitleChanges", &TestRunner::dumpTitleChanges); 140 145 141 146 // The following methods interact with the WebTestProxy. … … 208 213 m_dumpChildFramesAsText = false; 209 214 m_dumpAsAudio = false; 215 m_dumpFrameLoadCallbacks = false; 216 m_dumpUserGestureInFrameLoadCallbacks = false; 217 m_stopProvisionalFrameLoads = false; 218 m_dumpTitleChanges = false; 210 219 211 220 m_globalFlag.set(false); … … 215 224 } 216 225 226 void TestRunner::setTestIsRunning(bool running) 227 { 228 m_testIsRunning = running; 229 } 230 217 231 bool TestRunner::shouldDumpEditingCallbacks() const 218 232 { … … 258 272 { 259 273 return &m_audioData; 274 } 275 276 bool TestRunner::shouldDumpFrameLoadCallbacks() const 277 { 278 return m_testIsRunning && m_dumpFrameLoadCallbacks; 279 } 280 281 void TestRunner::setShouldDumpFrameLoadCallbacks(bool value) 282 { 283 m_dumpFrameLoadCallbacks = value; 284 } 285 286 bool TestRunner::shouldDumpUserGestureInFrameLoadCallbacks() const 287 { 288 return m_testIsRunning && m_dumpUserGestureInFrameLoadCallbacks; 289 } 290 291 bool TestRunner::stopProvisionalFrameLoads() const 292 { 293 return m_stopProvisionalFrameLoads; 294 } 295 296 bool TestRunner::shouldDumpTitleChanges() const 297 { 298 return m_dumpTitleChanges; 260 299 } 261 300 … … 1001 1040 } 1002 1041 1042 void TestRunner::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) 1043 { 1044 m_dumpFrameLoadCallbacks = true; 1045 result->setNull(); 1046 } 1047 1048 void TestRunner::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) 1049 { 1050 m_dumpUserGestureInFrameLoadCallbacks = true; 1051 result->setNull(); 1052 } 1053 1054 void TestRunner::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result) 1055 { 1056 result->setNull(); 1057 m_stopProvisionalFrameLoads = true; 1058 } 1059 1060 void TestRunner::dumpTitleChanges(const CppArgumentList&, CppVariant* result) 1061 { 1062 m_dumpTitleChanges = true; 1063 result->setNull(); 1064 } 1065 1003 1066 void TestRunner::workerThreadCount(CppVariant* result) 1004 1067 { -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
r138993 r139090 60 60 61 61 // WebTestRunner implementation. 62 virtual void setTestIsRunning(bool) OVERRIDE; 62 63 virtual bool shouldDumpEditingCallbacks() const OVERRIDE; 63 64 virtual bool shouldDumpAsText() const OVERRIDE; … … 69 70 virtual bool shouldDumpAsAudio() const OVERRIDE; 70 71 virtual const WebKit::WebArrayBufferView* audioData() const OVERRIDE; 72 virtual bool shouldDumpFrameLoadCallbacks() const OVERRIDE; 73 virtual void setShouldDumpFrameLoadCallbacks(bool) OVERRIDE; 74 virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const OVERRIDE; 75 virtual bool stopProvisionalFrameLoads() const OVERRIDE; 76 virtual bool shouldDumpTitleChanges() const OVERRIDE; 71 77 72 78 protected: … … 211 217 void setAudioData(const CppArgumentList&, CppVariant*); 212 218 219 // This function sets a flag that tells the test_shell to print a line of 220 // descriptive text for each frame load callback. It takes no arguments, and 221 // ignores any that may be present. 222 void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*); 223 224 // This function sets a flag that tells the test_shell to print a line of 225 // user gesture status text for some frame load callbacks. It takes no 226 // arguments, and ignores any that may be present. 227 void dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant*); 228 229 // If true, causes provisional frame loads to be stopped for the remainder of 230 // the test. 231 void setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant*); 232 233 void dumpTitleChanges(const CppArgumentList&, CppVariant*); 234 213 235 /////////////////////////////////////////////////////////////////////////// 214 236 // Methods interacting with the WebTestProxy … … 245 267 int numberOfActiveAnimations(); 246 268 269 bool m_testIsRunning; 270 247 271 WebKit::WebURL m_userStyleSheetLocation; 248 272 … … 275 299 bool m_dumpAsAudio; 276 300 301 // If true, the test_shell will output a descriptive line for each frame 302 // load callback. 303 bool m_dumpFrameLoadCallbacks; 304 305 // If true, the test_shell will output a line of the user gesture status 306 // text for some frame load callbacks. 307 bool m_dumpUserGestureInFrameLoadCallbacks; 308 309 // If true, stops provisional frame loads during the 310 // DidStartProvisionalLoadForFrame callback. 311 bool m_stopProvisionalFrameLoads; 312 313 // If true, output a message when the page title is changed. 314 bool m_dumpTitleChanges; 315 277 316 // WAV audio data is stored here. 278 317 WebKit::WebArrayBufferView m_audioData; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp
r137993 r139090 37 37 #include "WebEventSender.h" 38 38 #include "WebTestDelegate.h" 39 #include "WebTestRunner.h" 39 40 40 41 using WebKit::WebContextMenuData; … … 54 55 TestInterfaces* testInterfaces() { return &m_interfaces; } 55 56 void setDelegate(WebTestDelegate*); 57 void setWebView(WebView*); 58 void setTestIsRunning(bool); 59 WebView* webView() const { return m_webView; } 56 60 WebAccessibilityController* accessibilityController() { return &m_accessibilityController; } 57 61 WebEventSender* eventSender() { return &m_eventSender; } … … 75 79 private: 76 80 TestInterfaces m_interfaces; 81 bool m_testIsRunning; 82 WebView* m_webView; 77 83 WebAccessibilityController m_accessibilityController; 78 84 WebEventSender m_eventSender; … … 82 88 83 89 WebTestInterfaces::Internal::Internal() 84 : m_accessibilityController(m_interfaces.accessibilityController()) 90 : m_testIsRunning(false) 91 , m_webView(0) 92 , m_accessibilityController(m_interfaces.accessibilityController()) 85 93 , m_eventSender(m_interfaces.eventSender()) 86 94 , m_testRunner(0) … … 104 112 } 105 113 114 void WebTestInterfaces::Internal::setWebView(WebView* webView) 115 { 116 m_webView = webView; 117 m_interfaces.setWebView(webView); 118 } 119 120 void WebTestInterfaces::Internal::setTestIsRunning(bool running) 121 { 122 if (m_testRunner) 123 m_testRunner->setTestIsRunning(running); 124 } 125 106 126 void WebTestInterfaces::Internal::clearContextMenuData() 107 127 { … … 176 196 void WebTestInterfaces::setWebView(WebView* webView) 177 197 { 178 m_internal-> testInterfaces()->setWebView(webView);198 m_internal->setWebView(webView); 179 199 } 180 200 … … 194 214 } 195 215 216 void WebTestInterfaces::setTestIsRunning(bool running) 217 { 218 m_internal->setTestIsRunning(running); 219 } 220 221 WebView* WebTestInterfaces::webView() const 222 { 223 return m_internal->webView(); 224 } 225 196 226 WebAccessibilityController* WebTestInterfaces::accessibilityController() 197 227 { -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
r138239 r139090 37 37 #include "WebElement.h" 38 38 #include "WebEventSender.h" 39 #include "WebFrame.h" 39 40 #include "WebIntent.h" 40 41 #include "WebIntentRequest.h" … … 45 46 #include "WebTestInterfaces.h" 46 47 #include "WebTestRunner.h" 48 #include "WebView.h" 47 49 #include "platform/WebCString.h" 48 50 #include <wtf/StringExtras.h> … … 115 117 } 116 118 119 void printFrameDescription(WebTestDelegate* delegate, WebFrame* frame) 120 { 121 string name8 = frame->uniqueName().utf8(); 122 if (frame == frame->view()->mainFrame()) { 123 if (!name8.length()) { 124 delegate->printMessage("main frame"); 125 return; 126 } 127 delegate->printMessage(string("main frame \"") + name8 + "\""); 128 return; 129 } 130 if (!name8.length()) { 131 delegate->printMessage("frame (anonymous)"); 132 return; 133 } 134 delegate->printMessage(string("frame \"") + name8 + "\""); 135 } 136 137 void printFrameUserGestureStatus(WebTestDelegate* delegate, WebFrame* frame, const char* msg) 138 { 139 bool isUserGesture = frame->isProcessingUserGesture(); 140 delegate->printMessage(string("Frame with user gesture \"") + (isUserGesture ? "true" : "false") + "\"" + msg); 141 } 142 117 143 } 118 144 … … 427 453 } 428 454 429 } 455 void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&, const WebURL& to, double, double) 456 { 457 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 458 printFrameDescription(m_delegate, frame); 459 m_delegate->printMessage(string(" - willPerformClientRedirectToURL: ") + to.spec().data() + " \n"); 460 } 461 462 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpUserGestureInFrameLoadCallbacks()) 463 printFrameUserGestureStatus(m_delegate, frame, " - in willPerformClientRedirect\n"); 464 } 465 466 void WebTestProxyBase::didCancelClientRedirect(WebFrame* frame) 467 { 468 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 469 printFrameDescription(m_delegate, frame); 470 m_delegate->printMessage(" - didCancelClientRedirectForFrame\n"); 471 } 472 } 473 474 void WebTestProxyBase::didStartProvisionalLoad(WebFrame* frame) 475 { 476 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 477 printFrameDescription(m_delegate, frame); 478 m_delegate->printMessage(" - didStartProvisionalLoadForFrame\n"); 479 } 480 481 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpUserGestureInFrameLoadCallbacks()) 482 printFrameUserGestureStatus(m_delegate, frame, " - in didStartProvisionalLoadForFrame\n"); 483 484 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->stopProvisionalFrameLoads()) { 485 printFrameDescription(m_delegate, frame); 486 m_delegate->printMessage(" - stopping load in didStartProvisionalLoadForFrame callback\n"); 487 frame->stopLoading(); 488 } 489 } 490 491 void WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame) 492 { 493 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 494 printFrameDescription(m_delegate, frame); 495 m_delegate->printMessage(" - didReceiveServerRedirectForProvisionalLoadForFrame\n"); 496 } 497 } 498 499 void WebTestProxyBase::didFailProvisionalLoad(WebFrame* frame, const WebURLError&) 500 { 501 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 502 printFrameDescription(m_delegate, frame); 503 m_delegate->printMessage(" - didFailProvisionalLoadWithError\n"); 504 } 505 } 506 507 void WebTestProxyBase::didCommitProvisionalLoad(WebFrame* frame, bool) 508 { 509 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 510 printFrameDescription(m_delegate, frame); 511 m_delegate->printMessage(" - didCommitLoadForFrame\n"); 512 } 513 } 514 515 void WebTestProxyBase::didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection) 516 { 517 WebCString title8 = title.utf8(); 518 519 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 520 printFrameDescription(m_delegate, frame); 521 m_delegate->printMessage(string(" - didReceiveTitle: ") + title8.data() + "\n"); 522 } 523 524 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpTitleChanges()) 525 m_delegate->printMessage(string("TITLE CHANGED: '") + title8.data() + "'\n"); 526 527 } 528 529 void WebTestProxyBase::didFinishDocumentLoad(WebFrame* frame) 530 { 531 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 532 printFrameDescription(m_delegate, frame); 533 m_delegate->printMessage(" - didFinishDocumentLoadForFrame\n"); 534 } else { 535 unsigned pendingUnloadEvents = frame->unloadListenerCount(); 536 if (pendingUnloadEvents) { 537 printFrameDescription(m_delegate, frame); 538 char buffer[100]; 539 snprintf(buffer, sizeof(buffer), " - has %u onunload handler(s)\n", pendingUnloadEvents); 540 m_delegate->printMessage(buffer); 541 } 542 } 543 } 544 545 void WebTestProxyBase::didHandleOnloadEvents(WebFrame* frame) 546 { 547 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 548 printFrameDescription(m_delegate, frame); 549 m_delegate->printMessage(" - didHandleOnloadEventsForFrame\n"); 550 } 551 } 552 553 void WebTestProxyBase::didFailLoad(WebFrame* frame, const WebURLError&) 554 { 555 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 556 printFrameDescription(m_delegate, frame); 557 m_delegate->printMessage(" - didFailLoadWithError\n"); 558 } 559 } 560 561 void WebTestProxyBase::didFinishLoad(WebFrame* frame) 562 { 563 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 564 printFrameDescription(m_delegate, frame); 565 m_delegate->printMessage(" - didFinishLoadForFrame\n"); 566 } 567 } 568 569 void WebTestProxyBase::didChangeLocationWithinPage(WebFrame* frame) 570 { 571 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 572 printFrameDescription(m_delegate, frame); 573 m_delegate->printMessage(" - didChangeLocationWithinPageForFrame\n"); 574 } 575 } 576 577 void WebTestProxyBase::didDisplayInsecureContent(WebFrame*) 578 { 579 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) 580 m_delegate->printMessage("didDisplayInsecureContent\n"); 581 } 582 583 void WebTestProxyBase::didRunInsecureContent(WebFrame*, const WebSecurityOrigin&, const WebURL&) 584 { 585 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) 586 m_delegate->printMessage("didRunInsecureContent\n"); 587 } 588 589 void WebTestProxyBase::didDetectXSS(WebFrame*, const WebURL&, bool) 590 { 591 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) 592 m_delegate->printMessage("didDetectXSS\n"); 593 } 594 595 } -
trunk/Tools/DumpRenderTree/chromium/TestShell.cpp
r138993 r139090 258 258 m_dumpPixelsForCurrentTest = shouldDumpPixels; 259 259 m_testIsPreparing = true; 260 m_testInterfaces->setTestIsRunning(true); 260 261 m_params = params; 261 262 string testUrl = m_params.testUrl.spec(); … … 390 391 return; 391 392 m_testIsPending = false; 393 m_testInterfaces->setTestIsRunning(false); 392 394 if (m_dumpWhenFinished) 393 395 dump(); -
trunk/Tools/DumpRenderTree/chromium/TestShell.h
r137710 r139090 112 112 113 113 void setFocus(WebKit::WebWidget*, bool enable); 114 bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpFrameLoadCallbacks(); }115 114 bool shouldDumpResourceRequestCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceRequestCallbacks(); } 116 bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpUserGestureInFrameLoadCallbacks(); }117 115 bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceLoadCallbacks(); } 118 116 bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceResponseMIMETypes(); } -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r137997 r139090 855 855 } 856 856 857 void WebViewHost::willPerformClientRedirect(WebFrame* frame, const WebURL& from, const WebURL& to,858 double interval, double fire_time)859 {860 if (m_shell->shouldDumpFrameLoadCallbacks()) {861 printFrameDescription(frame);862 printf(" - willPerformClientRedirectToURL: %s \n", to.spec().data());863 }864 865 if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks())866 printFrameUserGestureStatus(frame, " - in willPerformClientRedirect\n");867 }868 869 void WebViewHost::didCancelClientRedirect(WebFrame* frame)870 {871 if (!m_shell->shouldDumpFrameLoadCallbacks())872 return;873 printFrameDescription(frame);874 fputs(" - didCancelClientRedirectForFrame\n", stdout);875 }876 877 857 void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds) 878 858 { … … 884 864 void WebViewHost::didStartProvisionalLoad(WebFrame* frame) 885 865 { 886 if (m_shell->shouldDumpFrameLoadCallbacks()) {887 printFrameDescription(frame);888 fputs(" - didStartProvisionalLoadForFrame\n", stdout);889 }890 891 if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks())892 printFrameUserGestureStatus(frame, " - in didStartProvisionalLoadForFrame\n");893 894 866 if (!m_topLoadingFrame) 895 867 m_topLoadingFrame = frame; 896 868 897 if (testRunner()->stopProvisionalFrameLoads()) {898 printFrameDescription(frame);899 fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout);900 frame->stopLoading();901 }902 869 updateAddressBar(frame->view()); 903 870 } … … 905 872 void WebViewHost::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame) 906 873 { 907 if (m_shell->shouldDumpFrameLoadCallbacks()) {908 printFrameDescription(frame);909 fputs(" - didReceiveServerRedirectForProvisionalLoadForFrame\n", stdout);910 }911 874 updateAddressBar(frame->view()); 912 875 } … … 914 877 void WebViewHost::didFailProvisionalLoad(WebFrame* frame, const WebURLError& error) 915 878 { 916 if (m_shell->shouldDumpFrameLoadCallbacks()) {917 printFrameDescription(frame);918 fputs(" - didFailProvisionalLoadWithError\n", stdout);919 }920 921 879 locationChangeDone(frame); 922 880 … … 927 885 void WebViewHost::didCommitProvisionalLoad(WebFrame* frame, bool isNewNavigation) 928 886 { 929 if (m_shell->shouldDumpFrameLoadCallbacks()) {930 printFrameDescription(frame);931 fputs(" - didCommitLoadForFrame\n", stdout);932 }933 887 updateForCommittedLoad(frame, isNewNavigation); 934 888 } … … 941 895 void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection direction) 942 896 { 943 WebCString title8 = title.utf8();944 945 if (m_shell->shouldDumpFrameLoadCallbacks()) {946 printFrameDescription(frame);947 printf(" - didReceiveTitle: %s\n", title8.data());948 }949 950 if (testRunner()->shouldDumpTitleChanges())951 printf("TITLE CHANGED: '%s'\n", title8.data());952 953 897 setPageTitle(title); 954 898 testRunner()->setTitleTextDirection(direction); 955 899 } 956 900 957 void WebViewHost::didFinishDocumentLoad(WebFrame* frame)958 {959 if (m_shell->shouldDumpFrameLoadCallbacks()) {960 printFrameDescription(frame);961 fputs(" - didFinishDocumentLoadForFrame\n", stdout);962 } else {963 unsigned pendingUnloadEvents = frame->unloadListenerCount();964 if (pendingUnloadEvents) {965 printFrameDescription(frame);966 printf(" - has %u onunload handler(s)\n", pendingUnloadEvents);967 }968 }969 }970 971 void WebViewHost::didHandleOnloadEvents(WebFrame* frame)972 {973 if (m_shell->shouldDumpFrameLoadCallbacks()) {974 printFrameDescription(frame);975 fputs(" - didHandleOnloadEventsForFrame\n", stdout);976 }977 }978 979 901 void WebViewHost::didFailLoad(WebFrame* frame, const WebURLError& error) 980 902 { 981 if (m_shell->shouldDumpFrameLoadCallbacks()) {982 printFrameDescription(frame);983 fputs(" - didFailLoadWithError\n", stdout);984 }985 903 locationChangeDone(frame); 986 904 } … … 988 906 void WebViewHost::didFinishLoad(WebFrame* frame) 989 907 { 990 if (m_shell->shouldDumpFrameLoadCallbacks()) {991 printFrameDescription(frame);992 fputs(" - didFinishLoadForFrame\n", stdout);993 }994 908 updateAddressBar(frame->view()); 995 909 locationChangeDone(frame); … … 1001 915 1002 916 updateForCommittedLoad(frame, isNewNavigation); 1003 }1004 1005 void WebViewHost::didChangeLocationWithinPage(WebFrame* frame)1006 {1007 if (m_shell->shouldDumpFrameLoadCallbacks()) {1008 printFrameDescription(frame);1009 fputs(" - didChangeLocationWithinPageForFrame\n", stdout);1010 }1011 917 } 1012 918 … … 1142 1048 } 1143 1049 removeIdentifierForRequest(identifier); 1144 }1145 1146 void WebViewHost::didDisplayInsecureContent(WebFrame*)1147 {1148 if (m_shell->shouldDumpFrameLoadCallbacks())1149 fputs("didDisplayInsecureContent\n", stdout);1150 }1151 1152 void WebViewHost::didRunInsecureContent(WebFrame*, const WebSecurityOrigin& origin, const WebURL& insecureURL)1153 {1154 if (m_shell->shouldDumpFrameLoadCallbacks())1155 fputs("didRunInsecureContent\n", stdout);1156 }1157 1158 void WebViewHost::didDetectXSS(WebFrame*, const WebURL&, bool)1159 {1160 if (m_shell->shouldDumpFrameLoadCallbacks())1161 fputs("didDetectXSS\n", stdout);1162 1050 } 1163 1051 … … 1590 1478 } 1591 1479 1592 void WebViewHost::printFrameUserGestureStatus(WebFrame* webframe, const char* msg)1593 {1594 bool isUserGesture = webframe->isProcessingUserGesture();1595 printf("Frame with user gesture \"%s\"%s", isUserGesture ? "true" : "false", msg);1596 }1597 1598 1480 void WebViewHost::printResourceDescription(unsigned identifier) 1599 1481 { -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.h
r137997 r139090 245 245 virtual WebKit::WebURLError cancelledError(WebKit::WebFrame*, const WebKit::WebURLRequest&); 246 246 virtual void unableToImplementPolicyWithError(WebKit::WebFrame*, const WebKit::WebURLError&); 247 virtual void willPerformClientRedirect(248 WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to,249 double interval, double fireTime);250 virtual void didCancelClientRedirect(WebKit::WebFrame*);251 247 virtual void didCreateDataSource(WebKit::WebFrame*, WebKit::WebDataSource*); 252 248 virtual void didStartProvisionalLoad(WebKit::WebFrame*); … … 256 252 virtual void didClearWindowObject(WebKit::WebFrame*); 257 253 virtual void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString&, WebKit::WebTextDirection); 258 virtual void didFinishDocumentLoad(WebKit::WebFrame*);259 virtual void didHandleOnloadEvents(WebKit::WebFrame*);260 254 virtual void didFailLoad(WebKit::WebFrame*, const WebKit::WebURLError&); 261 255 virtual void didFinishLoad(WebKit::WebFrame*); 262 256 virtual void didNavigateWithinPage(WebKit::WebFrame*, bool isNewNavigation); 263 virtual void didChangeLocationWithinPage(WebKit::WebFrame*);264 257 virtual void assignIdentifierToRequest(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLRequest&); 265 258 virtual void removeIdentifierForRequest(unsigned identifier); … … 269 262 virtual void didFinishResourceLoad(WebKit::WebFrame*, unsigned identifier); 270 263 virtual void didFailResourceLoad(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLError&); 271 virtual void didDisplayInsecureContent(WebKit::WebFrame*);272 virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&);273 virtual void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL&, bool didBlockEntirePage);274 264 virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*); 275 265 virtual void deleteFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, WebKit::WebFileSystemCallbacks*); … … 335 325 void printFrameDescription(WebKit::WebFrame*); 336 326 337 // Dumping the user gesture status to the console.338 void printFrameUserGestureStatus(WebKit::WebFrame*, const char*);339 340 327 bool hasWindow() const { return m_hasWindow; } 341 328 void resetScrollRect();
Note: See TracChangeset
for help on using the changeset viewer.