Changeset 104902 in webkit


Ignore:
Timestamp:
Jan 13, 2012 12:47:04 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Mac][DRT] Should support --no-timeout
https://bugs.webkit.org/show_bug.cgi?id=76242

Patch by Hajime Morrita <morrita@chromium.org> on 2012-01-13
Reviewed by Darin Adler.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(initializeGlobalsFromCommandLineOptions): Added "--no-timeout" to the options list.
(setWaitToDumpWatchdog): Added to encapsulate the waitToDumpWatchdog global variable.
(shouldSetWaitToDumpWatchdog): Added to check the useTimeoutWatchdog flag set by the option.

  • DumpRenderTree/mac/DumpRenderTreeMac.h:
  • DumpRenderTree/mac/LayoutTestControllerMac.mm:

(LayoutTestController::setWaitToDump): Now calls shouldSetWaitToDumpWatchdog() to check the flag.

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r104881 r104902  
     12012-01-13  Hajime Morrita  <morrita@chromium.org>
     2
     3        [Mac][DRT] Should support --no-timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=76242
     5
     6        Reviewed by Darin Adler.
     7
     8        * DumpRenderTree/mac/DumpRenderTree.mm:
     9        (initializeGlobalsFromCommandLineOptions): Added "--no-timeout" to the options list.
     10        (setWaitToDumpWatchdog): Added to encapsulate the waitToDumpWatchdog global variable.
     11        (shouldSetWaitToDumpWatchdog): Added to check the useTimeoutWatchdog flag set by the option.
     12        * DumpRenderTree/mac/DumpRenderTreeMac.h:
     13        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
     14        (LayoutTestController::setWaitToDump): Now calls shouldSetWaitToDumpWatchdog() to check the flag.
     15
    1162012-01-12  Simon Fraser  <simon.fraser@apple.com>
    217
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r104881 r104902  
    130130
    131131CFMutableSetRef disallowedURLs = 0;
    132 CFRunLoopTimerRef waitToDumpWatchdog = 0;
     132static CFRunLoopTimerRef waitToDumpWatchdog = 0;
    133133
    134134// Delegates
     
    144144static int threaded;
    145145static int dumpTree = YES;
     146static int useTimeoutWatchdog = YES;
    146147static int forceComplexText;
    147148static int gcBetweenTests;
     
    766767        {"complex-text", no_argument, &forceComplexText, YES},
    767768        {"gc-between-tests", no_argument, &gcBetweenTests, YES},
     769        {"no-timeout", no_argument, &useTimeoutWatchdog, NO},
    768770        {NULL, 0, NULL, 0}
    769771    };
     
    11001102        waitToDumpWatchdog = 0;
    11011103    }
     1104}
     1105
     1106void setWaitToDumpWatchdog(CFRunLoopTimerRef timer)
     1107{
     1108    ASSERT(timer);
     1109    ASSERT(shouldSetWaitToDumpWatchdog());
     1110    waitToDumpWatchdog = timer;
     1111    CFRunLoopAddTimer(CFRunLoopGetCurrent(), waitToDumpWatchdog, kCFRunLoopCommonModes);
     1112}
     1113
     1114bool shouldSetWaitToDumpWatchdog()
     1115{
     1116    return !waitToDumpWatchdog && useTimeoutWatchdog;
    11021117}
    11031118
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTreeMac.h

    r80892 r104902  
    6262extern const unsigned maxViewWidth;
    6363
    64 extern CFRunLoopTimerRef waitToDumpWatchdog;
     64void setWaitToDumpWatchdog(CFRunLoopTimerRef);
     65bool shouldSetWaitToDumpWatchdog();
    6566
    6667WebView* createWebViewAndOffscreenWindow();
  • trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm

    r101953 r104902  
    725725{
    726726    m_waitToDump = waitUntilDone;
    727     if (m_waitToDump && !waitToDumpWatchdog) {
    728         waitToDumpWatchdog = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogInterval, 0, 0, 0, waitUntilDoneWatchdogFired, NULL);
    729         CFRunLoopAddTimer(CFRunLoopGetCurrent(), waitToDumpWatchdog, kCFRunLoopCommonModes);
    730     }
     727    if (m_waitToDump && shouldSetWaitToDumpWatchdog())
     728        setWaitToDumpWatchdog(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogInterval, 0, 0, 0, waitUntilDoneWatchdogFired, NULL));
    731729}
    732730
Note: See TracChangeset for help on using the changeset viewer.