Changeset 139627 in webkit
- Timestamp:
- Jan 14, 2013 11:04:39 AM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r139613 r139627 1 2013-01-14 Jochen Eisinger <jochen@chromium.org> 2 3 [chromium] move remaining methods to dump WebViewClient callbacks to TestRunner library 4 https://bugs.webkit.org/show_bug.cgi?id=106785 5 6 Reviewed by Adam Barth. 7 8 * DumpRenderTree/chromium/DRTTestRunner.cpp: 9 (DRTTestRunner::DRTTestRunner): 10 (DRTTestRunner::reset): 11 * DumpRenderTree/chromium/DRTTestRunner.h: 12 (DRTTestRunner): 13 * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h: 14 (WebTestProxyBase): 15 (WebTestRunner::WebTestProxy::setStatusText): 16 (WebTestRunner::WebTestProxy::didStopLoading): 17 * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h: 18 (WebTestRunner::WebTestRunner::shouldDumpStatusCallbacks): 19 (WebTestRunner::WebTestRunner::shouldDumpProgressFinishedCallback): 20 * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: 21 (WebTestRunner::TestRunner::TestRunner): 22 (WebTestRunner::TestRunner::reset): 23 (WebTestRunner::TestRunner::shouldDumpStatusCallbacks): 24 (WebTestRunner): 25 (WebTestRunner::TestRunner::shouldDumpProgressFinishedCallback): 26 (WebTestRunner::TestRunner::dumpWindowStatusChanges): 27 (WebTestRunner::TestRunner::dumpProgressFinishedCallback): 28 * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: 29 (TestRunner): 30 * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp: 31 (WebTestRunner::WebTestProxyBase::setStatusText): 32 (WebTestRunner): 33 (WebTestRunner::WebTestProxyBase::didStopLoading): 34 * DumpRenderTree/chromium/WebViewHost.cpp: 35 (WebViewHost::didStopLoading): 36 * DumpRenderTree/chromium/WebViewHost.h: 37 (WebViewHost): 38 1 39 2013-01-14 Andrey Lushnikov <lushnikov@chromium.org> 2 40 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
r139549 r139627 116 116 bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion); 117 117 bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList); 118 bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);119 118 bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect); 120 bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges);121 119 #if ENABLE(NOTIFICATIONS) 122 120 bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission); … … 228 226 } 229 227 230 void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)231 {232 m_dumpProgressFinishedCallback = true;233 result->setNull();234 }235 236 void DRTTestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)237 {238 m_dumpWindowStatusChanges = true;239 result->setNull();240 }241 242 228 void DRTTestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result) 243 229 { … … 424 410 if (m_shell) 425 411 m_shell->webViewHost()->setDeviceScaleFactor(1); 426 m_dumpProgressFinishedCallback = false;427 412 m_dumpBackForwardList = false; 428 m_dumpWindowStatusChanges = false;429 413 m_dumpSelectionRect = false; 430 414 m_waitUntilDone = false; -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h
r139549 r139627 76 76 virtual ~DRTTestRunner(); 77 77 78 // This function sets a flag that tells the test_shell to print a line of79 // descriptive text for the progress finished callback. It takes no80 // arguments, and ignores any that may be present.81 void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*);82 83 78 // This function sets a flag that tells the test_shell to print out a text 84 79 // representation of the back/forward list. It ignores all arguments. 85 80 void dumpBackForwardList(const CppArgumentList&, CppVariant*); 86 87 // This function sets a flag that tells the test_shell to dump all calls88 // to window.status().89 // It takes no arguments, and ignores any that may be present.90 void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*);91 81 92 82 // Functions for dealing with windows. By default we block all new windows. … … 203 193 void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); } 204 194 205 bool shouldDumpProgressFinishedCallback() { return m_dumpProgressFinishedCallback; }206 void setShouldDumpProgressFinishedCallback(bool value) { m_dumpProgressFinishedCallback = value; }207 bool shouldDumpStatusCallbacks() { return m_dumpWindowStatusChanges; }208 195 bool shouldDumpSelectionRect() { return m_dumpSelectionRect; } 209 196 bool shouldDumpBackForwardList() { return m_dumpBackForwardList; } … … 301 288 bool m_dumpSelectionRect; 302 289 303 // If true, the test_shell will output a descriptive line for the progress304 // finished callback.305 bool m_dumpProgressFinishedCallback;306 307 290 // If true, the test_shell will produce a dump of the back forward list as 308 291 // well. 309 292 bool m_dumpBackForwardList; 310 311 // If true, the test_shell will dump all changes to window.status.312 bool m_dumpWindowStatusChanges;313 293 314 294 // When reset is called, go through and close all but the main test shell -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h
r139234 r139627 108 108 void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest&); 109 109 WebKit::WebView* createView(WebKit::WebFrame* creator, const WebKit::WebURLRequest&, const WebKit::WebWindowFeatures&, const WebKit::WebString& frameName, WebKit::WebNavigationPolicy); 110 void setStatusText(const WebKit::WebString&); 111 void didStopLoading(); 112 110 113 void willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time); 111 114 void didCancelClientRedirect(WebKit::WebFrame*); … … 266 269 return Base::createView(creator, request, features, frameName, policy); 267 270 } 271 virtual void setStatusText(const WebKit::WebString& text) 272 { 273 WebTestProxyBase::setStatusText(text); 274 Base::setStatusText(text); 275 } 276 virtual void didStopLoading() 277 { 278 WebTestProxyBase::didStopLoading(); 279 Base::didStopLoading(); 280 } 268 281 269 282 // WebFrameClient implementation. -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h
r139355 r139627 64 64 virtual bool shouldDumpResourceResponseMIMETypes() const { return false; } 65 65 virtual WebKit::WebPermissionClient* webPermissions() const { return 0; } 66 virtual bool shouldDumpStatusCallbacks() const { return false; } 67 virtual bool shouldDumpProgressFinishedCallback() const { return false; } 66 68 }; 67 69 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
r139549 r139627 161 161 bindMethod("setAllowDisplayOfInsecureContent", &TestRunner::setAllowDisplayOfInsecureContent); 162 162 bindMethod("setAllowRunningOfInsecureContent", &TestRunner::setAllowRunningOfInsecureContent); 163 bindMethod("dumpStatusCallbacks", &TestRunner::dumpWindowStatusChanges); 164 bindMethod("dumpProgressFinishedCallback", &TestRunner::dumpProgressFinishedCallback); 163 165 164 166 // The following methods interact with the WebTestProxy. … … 251 253 m_dumpResourceRequestCallbacks = false; 252 254 m_dumpResourceResponseMIMETypes = false; 255 m_dumpWindowStatusChanges = false; 256 m_dumpProgressFinishedCallback = false; 253 257 254 258 m_globalFlag.set(false); … … 365 369 } 366 370 371 bool TestRunner::shouldDumpStatusCallbacks() const 372 { 373 return m_dumpWindowStatusChanges; 374 } 375 376 bool TestRunner::shouldDumpProgressFinishedCallback() const 377 { 378 return m_dumpProgressFinishedCallback; 379 } 380 367 381 void TestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result) 368 382 { … … 412 426 m_webPermissions->setRunningInsecureContentAllowed(arguments[0].value.boolValue); 413 427 428 result->setNull(); 429 } 430 431 void TestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result) 432 { 433 m_dumpWindowStatusChanges = true; 434 result->setNull(); 435 } 436 437 void TestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result) 438 { 439 m_dumpProgressFinishedCallback = true; 414 440 result->setNull(); 415 441 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
r139549 r139627 82 82 virtual bool shouldDumpResourceResponseMIMETypes() const OVERRIDE; 83 83 virtual WebKit::WebPermissionClient* webPermissions() const OVERRIDE; 84 virtual bool shouldDumpStatusCallbacks() const OVERRIDE; 85 virtual bool shouldDumpProgressFinishedCallback() const OVERRIDE; 84 86 85 87 protected: … … 279 281 void dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant*); 280 282 283 // This function sets a flag that tells the test_shell to dump all calls 284 // to window.status(). 285 // It takes no arguments, and ignores any that may be present. 286 void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*); 287 288 // This function sets a flag that tells the test_shell to print a line of 289 // descriptive text for the progress finished callback. It takes no 290 // arguments, and ignores any that may be present. 291 void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*); 292 281 293 /////////////////////////////////////////////////////////////////////////// 282 294 // Methods interacting with the WebTestProxy … … 391 403 bool m_dumpResourceResponseMIMETypes; 392 404 405 // If true, the test_shell will dump all changes to window.status. 406 bool m_dumpWindowStatusChanges; 407 408 // If true, the test_shell will output a descriptive line for the progress 409 // finished callback. 410 bool m_dumpProgressFinishedCallback; 411 393 412 // WAV audio data is stored here. 394 413 WebKit::WebArrayBufferView m_audioData; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
r139234 r139627 508 508 } 509 509 510 void WebTestProxyBase::setStatusText(const WebString& text) 511 { 512 if (!m_testInterfaces->testRunner() || !m_testInterfaces->testRunner()->shouldDumpStatusCallbacks()) 513 return; 514 m_delegate->printMessage(string("UI DELEGATE STATUS CALLBACK: setStatusText:") + text.utf8().data() + "\n"); 515 } 516 517 void WebTestProxyBase::didStopLoading() 518 { 519 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpProgressFinishedCallback()) 520 m_delegate->printMessage("postProgressFinishedNotification\n"); 521 } 522 510 523 void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&, const WebURL& to, double, double) 511 524 { -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r139549 r139627 249 249 void WebViewHost::didStopLoading() 250 250 { 251 if (testRunner()->shouldDumpProgressFinishedCallback())252 fputs("postProgressFinishedNotification\n", stdout);253 251 m_shell->setIsLoading(false); 254 252 } … … 426 424 { 427 425 m_lastContextMenuData = adoptPtr(new WebContextMenuData(contextMenuData)); 428 }429 430 void WebViewHost::setStatusText(const WebString& text)431 {432 if (!testRunner()->shouldDumpStatusCallbacks())433 return;434 // When running tests, write to stdout.435 printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data());436 426 } 437 427 -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.h
r139549 r139627 192 192 virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame*, const WebKit::WebString&); 193 193 virtual void showContextMenu(WebKit::WebFrame*, const WebKit::WebContextMenuData&); 194 virtual void setStatusText(const WebKit::WebString&);195 194 virtual void didUpdateLayout(); 196 195 virtual void navigateBackForwardSoon(int offset);
Note: See TracChangeset
for help on using the changeset viewer.