Changeset 139722 in webkit
- Timestamp:
- Jan 15, 2013 12:19:57 AM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r139715 r139722 1 2013-01-15 Jochen Eisinger <jochen@chromium.org> 2 3 [chromium] move remaining methods that just set a boolean flag to TestRunner library 4 https://bugs.webkit.org/show_bug.cgi?id=106823 5 6 Reviewed by Darin Fisher. 7 8 * DumpRenderTree/chromium/DRTTestRunner.cpp: 9 (DRTTestRunner::DRTTestRunner): 10 (DRTTestRunner::reset): 11 * DumpRenderTree/chromium/DRTTestRunner.h: 12 (DRTTestRunner): 13 * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h: 14 (WebTestRunner::WebTestRunner::shouldDumpBackForwardList): 15 (WebTestRunner::WebTestRunner::deferMainResourceDataLoad): 16 (WebTestRunner::WebTestRunner::shouldDumpSelectionRect): 17 (WebTestRunner::WebTestRunner::testRepaint): 18 (WebTestRunner::WebTestRunner::sweepHorizontally): 19 (WebTestRunner::WebTestRunner::isPrinting): 20 (WebTestRunner::WebTestRunner::shouldStayOnPageAfterHandlingBeforeUnload): 21 * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: 22 (WebTestRunner::TestRunner::TestRunner): 23 (WebTestRunner::TestRunner::reset): 24 (WebTestRunner::TestRunner::shouldDumpBackForwardList): 25 (WebTestRunner): 26 (WebTestRunner::TestRunner::deferMainResourceDataLoad): 27 (WebTestRunner::TestRunner::shouldDumpSelectionRect): 28 (WebTestRunner::TestRunner::testRepaint): 29 (WebTestRunner::TestRunner::sweepHorizontally): 30 (WebTestRunner::TestRunner::isPrinting): 31 (WebTestRunner::TestRunner::shouldStayOnPageAfterHandlingBeforeUnload): 32 (WebTestRunner::TestRunner::dumpBackForwardList): 33 (WebTestRunner::TestRunner::setDeferMainResourceDataLoad): 34 (WebTestRunner::TestRunner::dumpSelectionRect): 35 (WebTestRunner::TestRunner::repaintSweepHorizontally): 36 (WebTestRunner::TestRunner::setPrinting): 37 (WebTestRunner::TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload): 38 * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: 39 (TestRunner): 40 1 41 2013-01-14 Dirk Pranke <dpranke@chromium.org> 2 42 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
r139627 r139722 88 88 : m_shell(shell) 89 89 , m_closeRemainingWindows(false) 90 , m_deferMainResourceDataLoad(false)91 90 , m_showDebugLayerTree(false) 92 91 , m_workQueue(this) 93 , m_shouldStayOnPageAfterHandlingBeforeUnload(false)94 92 { 95 93 … … 115 113 bindMethod("display", &DRTTestRunner::display); 116 114 bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion); 117 bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);118 bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);119 115 #if ENABLE(NOTIFICATIONS) 120 116 bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission); … … 130 126 bindMethod("queueNonLoadingScript", &DRTTestRunner::queueNonLoadingScript); 131 127 bindMethod("queueReload", &DRTTestRunner::queueReload); 132 bindMethod("repaintSweepHorizontally", &DRTTestRunner::repaintSweepHorizontally);133 128 bindMethod("setAlwaysAcceptCookies", &DRTTestRunner::setAlwaysAcceptCookies); 134 129 bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete); 135 130 bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate); 136 131 bindMethod("setDatabaseQuota", &DRTTestRunner::setDatabaseQuota); 137 bindMethod("setDeferMainResourceDataLoad", &DRTTestRunner::setDeferMainResourceDataLoad);138 132 bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission); 139 133 bindMethod("setMockDeviceOrientation", &DRTTestRunner::setMockDeviceOrientation); … … 145 139 #endif 146 140 bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale); 147 bindMethod("setPrinting", &DRTTestRunner::setPrinting);148 141 bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor); 149 142 bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader); … … 154 147 bindMethod("simulateLegacyWebNotificationClick", &DRTTestRunner::simulateLegacyWebNotificationClick); 155 148 #endif 156 bindMethod("testRepaint", &DRTTestRunner::testRepaint);157 149 bindMethod("waitForPolicyDelegate", &DRTTestRunner::waitForPolicyDelegate); 158 150 bindMethod("waitUntilDone", &DRTTestRunner::waitUntilDone); 159 151 bindMethod("windowCount", &DRTTestRunner::windowCount); 160 152 161 bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload);162 153 163 154 // Shared properties. … … 218 209 } 219 210 m_queue.append(work); 220 }221 222 void DRTTestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result)223 {224 m_dumpBackForwardList = true;225 result->setNull();226 211 } 227 212 … … 410 395 if (m_shell) 411 396 m_shell->webViewHost()->setDeviceScaleFactor(1); 412 m_dumpBackForwardList = false;413 m_dumpSelectionRect = false;414 397 m_waitUntilDone = false; 415 m_testRepaint = false;416 m_sweepHorizontally = false;417 m_deferMainResourceDataLoad = true;418 398 m_webHistoryItemCount.set(0); 419 399 m_titleTextDirection.set("ltr"); 420 400 m_interceptPostMessage.set(false); 421 m_isPrinting = false;422 401 423 402 webkit_support::SetAcceptAllCookies(false); … … 434 413 m_workQueue.reset(); 435 414 m_taskList.revokeAll(); 436 m_shouldStayOnPageAfterHandlingBeforeUnload = false;437 415 } 438 416 … … 591 569 #endif 592 570 593 void DRTTestRunner::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result)594 {595 if (arguments.size() == 1)596 m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]);597 }598 599 void DRTTestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result)600 {601 m_dumpSelectionRect = true;602 result->setNull();603 }604 605 571 void DRTTestRunner::display(const CppArgumentList& arguments, CppVariant* result) 606 572 { … … 622 588 } 623 589 624 void DRTTestRunner::testRepaint(const CppArgumentList&, CppVariant* result)625 {626 m_testRepaint = true;627 result->setNull();628 }629 630 void DRTTestRunner::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result)631 {632 m_sweepHorizontally = true;633 result->setNull();634 }635 636 590 void DRTTestRunner::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result) 637 591 { … … 652 606 if (arguments.size() == 1 && arguments[0].isString()) 653 607 setlocale(LC_ALL, arguments[0].toString().c_str()); 654 }655 656 void DRTTestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result)657 {658 setIsPrinting(true);659 result->setNull();660 608 } 661 609 … … 775 723 #endif 776 724 777 void DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result)778 {779 if (arguments.size() == 1 && arguments[0].isBool())780 m_shouldStayOnPageAfterHandlingBeforeUnload = arguments[0].toBoolean();781 782 result->setNull();783 }784 785 725 class InvokeCallbackTask : public WebMethodTask<DRTTestRunner> { 786 726 public: -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h
r139627 r139722 76 76 virtual ~DRTTestRunner(); 77 77 78 // This function sets a flag that tells the test_shell to print out a text79 // representation of the back/forward list. It ignores all arguments.80 void dumpBackForwardList(const CppArgumentList&, CppVariant*);81 82 78 // Functions for dealing with windows. By default we block all new windows. 83 79 void windowCount(const CppArgumentList&, CppVariant*); … … 126 122 void pathToLocalResource(const CppArgumentList&, CppVariant*); 127 123 128 void dumpSelectionRect(const CppArgumentList&, CppVariant*);129 130 124 #if ENABLE(NOTIFICATIONS) 131 125 // Grants permission for desktop notifications to an origin … … 135 129 #endif 136 130 137 void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*);138 139 131 void display(const CppArgumentList&, CppVariant*); 140 132 void displayInvalidatedRegion(const CppArgumentList&, CppVariant*); 141 void testRepaint(const CppArgumentList&, CppVariant*);142 void repaintSweepHorizontally(const CppArgumentList&, CppVariant*);143 133 144 134 // Clears all databases. … … 151 141 void setPOSIXLocale(const CppArgumentList&, CppVariant*); 152 142 153 // Causes layout to happen as if targetted to printed pages.154 void setPrinting(const CppArgumentList&, CppVariant*);155 156 143 // Gets the number of geolocation permissions requests pending. 157 144 void numberOfPendingGeolocationPermissionRequests(const CppArgumentList&, CppVariant*); … … 175 162 void wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant*); 176 163 #endif 177 178 void setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList&, CppVariant*);179 164 180 165 #if ENABLE(POINTER_LOCK) … … 193 178 void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); } 194 179 195 bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }196 bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }197 bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }198 180 void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; } 199 181 void setTitleTextDirection(WebKit::WebTextDirection dir) … … 207 189 } 208 190 209 void setIsPrinting(bool value) { m_isPrinting = value; }210 bool isPrinting() { return m_isPrinting; }211 212 bool testRepaint() const { return m_testRepaint; }213 bool sweepHorizontally() const { return m_sweepHorizontally; }214 215 191 // Called by the webview delegate when the toplevel frame load is done. 216 192 void locationChangeDone(); … … 234 210 235 211 WebTaskList* taskList() { return &m_taskList; } 236 237 bool shouldStayOnPageAfterHandlingBeforeUnload() const { return m_shouldStayOnPageAfterHandlingBeforeUnload; }238 212 239 213 private: … … 284 258 TestShell* m_shell; 285 259 286 // If true, the test_shell will draw the bounds of the current selection rect287 // taking possible transforms of the selection rect into account.288 bool m_dumpSelectionRect;289 290 // If true, the test_shell will produce a dump of the back forward list as291 // well.292 bool m_dumpBackForwardList;293 294 260 // When reset is called, go through and close all but the main test shell 295 261 // window. By default, set to true but toggled to false using … … 297 263 bool m_closeRemainingWindows; 298 264 299 // If true, pixel dump will be produced as a series of 1px-tall, view-wide300 // individual paints over the height of the view.301 bool m_testRepaint;302 // If true and test_repaint_ is true as well, pixel dump will be produced as303 // a series of 1px-wide, view-tall paints across the width of the view.304 bool m_sweepHorizontally;305 306 265 // If true, don't dump output until notifyDone is called. 307 266 bool m_waitUntilDone; 308 267 309 // If false, all new requests will not defer the main resource data load.310 bool m_deferMainResourceDataLoad;311 312 268 // If true, we will show extended information in the graphics layer tree. 313 269 bool m_showDebugLayerTree; 314 270 315 // If true, layout is to target printed pages.316 bool m_isPrinting;317 318 271 WorkQueue m_workQueue; 319 272 … … 326 279 // Bound variable to set whether postMessages should be intercepted or not 327 280 CppVariant m_interceptPostMessage; 328 329 bool m_shouldStayOnPageAfterHandlingBeforeUnload;330 281 }; 331 282 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h
r139627 r139722 66 66 virtual bool shouldDumpStatusCallbacks() const { return false; } 67 67 virtual bool shouldDumpProgressFinishedCallback() const { return false; } 68 virtual bool shouldDumpBackForwardList() const { return false; } 69 virtual bool deferMainResourceDataLoad() const { return false; } 70 virtual bool shouldDumpSelectionRect() const { return false; } 71 virtual bool testRepaint() const { return false; } 72 virtual bool sweepHorizontally() const { return false; } 73 virtual bool isPrinting() const { return false; } 74 virtual bool shouldStayOnPageAfterHandlingBeforeUnload() const { return false; } 68 75 }; 69 76 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
r139627 r139722 163 163 bindMethod("dumpStatusCallbacks", &TestRunner::dumpWindowStatusChanges); 164 164 bindMethod("dumpProgressFinishedCallback", &TestRunner::dumpProgressFinishedCallback); 165 bindMethod("dumpBackForwardList", &TestRunner::dumpBackForwardList); 166 bindMethod("setDeferMainResourceDataLoad", &TestRunner::setDeferMainResourceDataLoad); 167 bindMethod("dumpSelectionRect", &TestRunner::dumpSelectionRect); 168 bindMethod("testRepaint", &TestRunner::testRepaint); 169 bindMethod("repaintSweepHorizontally", &TestRunner::repaintSweepHorizontally); 170 bindMethod("setPrinting", &TestRunner::setPrinting); 171 bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload); 165 172 166 173 // The following methods interact with the WebTestProxy. … … 255 262 m_dumpWindowStatusChanges = false; 256 263 m_dumpProgressFinishedCallback = false; 264 m_dumpBackForwardList = false; 265 m_deferMainResourceDataLoad = true; 266 m_dumpSelectionRect = false; 267 m_testRepaint = false; 268 m_sweepHorizontally = false; 269 m_isPrinting = false; 270 m_shouldStayOnPageAfterHandlingBeforeUnload = false; 257 271 258 272 m_globalFlag.set(false); … … 379 393 } 380 394 395 bool TestRunner::shouldDumpBackForwardList() const 396 { 397 return m_dumpBackForwardList; 398 } 399 400 bool TestRunner::deferMainResourceDataLoad() const 401 { 402 return m_deferMainResourceDataLoad; 403 } 404 405 bool TestRunner::shouldDumpSelectionRect() const 406 { 407 return m_dumpSelectionRect; 408 } 409 410 bool TestRunner::testRepaint() const 411 { 412 return m_testRepaint; 413 } 414 415 bool TestRunner::sweepHorizontally() const 416 { 417 return m_sweepHorizontally; 418 } 419 420 bool TestRunner::isPrinting() const 421 { 422 return m_isPrinting; 423 } 424 425 bool TestRunner::shouldStayOnPageAfterHandlingBeforeUnload() const 426 { 427 return m_shouldStayOnPageAfterHandlingBeforeUnload; 428 } 429 381 430 void TestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result) 382 431 { … … 438 487 { 439 488 m_dumpProgressFinishedCallback = true; 489 result->setNull(); 490 } 491 492 void TestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result) 493 { 494 m_dumpBackForwardList = true; 495 result->setNull(); 496 } 497 498 void TestRunner::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result) 499 { 500 if (arguments.size() == 1) 501 m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]); 502 } 503 504 void TestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result) 505 { 506 m_dumpSelectionRect = true; 507 result->setNull(); 508 } 509 510 void TestRunner::testRepaint(const CppArgumentList&, CppVariant* result) 511 { 512 m_testRepaint = true; 513 result->setNull(); 514 } 515 516 void TestRunner::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result) 517 { 518 m_sweepHorizontally = true; 519 result->setNull(); 520 } 521 522 void TestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result) 523 { 524 m_isPrinting = true; 525 result->setNull(); 526 } 527 528 void TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result) 529 { 530 if (arguments.size() == 1 && arguments[0].isBool()) 531 m_shouldStayOnPageAfterHandlingBeforeUnload = arguments[0].toBoolean(); 532 440 533 result->setNull(); 441 534 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
r139627 r139722 84 84 virtual bool shouldDumpStatusCallbacks() const OVERRIDE; 85 85 virtual bool shouldDumpProgressFinishedCallback() const OVERRIDE; 86 virtual bool shouldDumpBackForwardList() const OVERRIDE; 87 virtual bool deferMainResourceDataLoad() const OVERRIDE; 88 virtual bool shouldDumpSelectionRect() const OVERRIDE; 89 virtual bool testRepaint() const OVERRIDE; 90 virtual bool sweepHorizontally() const OVERRIDE; 91 virtual bool isPrinting() const OVERRIDE; 92 virtual bool shouldStayOnPageAfterHandlingBeforeUnload() const OVERRIDE; 86 93 87 94 protected: … … 291 298 void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*); 292 299 300 // This function sets a flag that tells the test_shell to print out a text 301 // representation of the back/forward list. It ignores all arguments. 302 void dumpBackForwardList(const CppArgumentList&, CppVariant*); 303 304 void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*); 305 void dumpSelectionRect(const CppArgumentList&, CppVariant*); 306 void testRepaint(const CppArgumentList&, CppVariant*); 307 void repaintSweepHorizontally(const CppArgumentList&, CppVariant*); 308 309 // Causes layout to happen as if targetted to printed pages. 310 void setPrinting(const CppArgumentList&, CppVariant*); 311 312 void setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList&, CppVariant*); 313 293 314 /////////////////////////////////////////////////////////////////////////// 294 315 // Methods interacting with the WebTestProxy … … 410 431 bool m_dumpProgressFinishedCallback; 411 432 433 // If true, the test_shell will produce a dump of the back forward list as 434 // well. 435 bool m_dumpBackForwardList; 436 437 // If false, all new requests will not defer the main resource data load. 438 bool m_deferMainResourceDataLoad; 439 440 // If true, the test_shell will draw the bounds of the current selection rect 441 // taking possible transforms of the selection rect into account. 442 bool m_dumpSelectionRect; 443 444 // If true, pixel dump will be produced as a series of 1px-tall, view-wide 445 // individual paints over the height of the view. 446 bool m_testRepaint; 447 448 // If true and test_repaint_ is true as well, pixel dump will be produced as 449 // a series of 1px-wide, view-tall paints across the width of the view. 450 bool m_sweepHorizontally; 451 452 // If true, layout is to target printed pages. 453 bool m_isPrinting; 454 455 bool m_shouldStayOnPageAfterHandlingBeforeUnload; 456 412 457 // WAV audio data is stored here. 413 458 WebKit::WebArrayBufferView m_audioData;
Note: See TracChangeset
for help on using the changeset viewer.