Changeset 201821 in webkit


Ignore:
Timestamp:
Jun 8, 2016 12:17:52 PM (8 years ago)
Author:
aakash_jain@apple.com
Message:

tests fail if display sleeps while run-webkit-tests is running
https://bugs.webkit.org/show_bug.cgi?id=153919

Reviewed by Alexey Proskuryakov.

  • DumpRenderTree/mac/LayoutTestHelper.m:

(releaseSleepAssertions): Release both Display sleep and System sleep assertions.
(addSleepAssertions): Add sleep assertion for both Display sleep and System sleep.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r201819 r201821  
     12016-06-08  Aakash Jain  <aakash_jain@apple.com>
     2
     3        tests fail if display sleeps while run-webkit-tests is running
     4        https://bugs.webkit.org/show_bug.cgi?id=153919
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * DumpRenderTree/mac/LayoutTestHelper.m:
     9        (releaseSleepAssertions): Release both Display sleep and System sleep assertions.
     10        (addSleepAssertions): Add sleep assertion for both Display sleep and System sleep.
     11
    1122016-06-08  Lucas Forschler  <lforschler@apple.com>
    213
  • trunk/Tools/DumpRenderTree/mac/LayoutTestHelper.m

    r201489 r201821  
    4848
    4949static int installColorProfile = false;
    50 static uint32_t assertionID = 0;
     50static uint32_t assertionIDForDisplaySleep = 0;
     51static uint32_t assertionIDForSystemSleep = 0;
    5152
    5253static NSMutableDictionary *originalColorProfileURLs()
     
    196197}
    197198
    198 static void releaseDisplaySleepAssertion()
    199 {
    200     IOPMAssertionRelease(assertionID);
     199static void releaseSleepAssertions()
     200{
     201    IOPMAssertionRelease(assertionIDForDisplaySleep);
     202    IOPMAssertionRelease(assertionIDForSystemSleep);
    201203}
    202204
     
    205207    // Try to restore the color profile and try to go down cleanly
    206208    restoreUserColorProfile();
    207     releaseDisplaySleepAssertion();
     209    releaseSleepAssertions();
    208210    exit(128 + sig);
    209211}
     
    241243}
    242244
    243 void addDisplaySleepAssertion()
     245void addSleepAssertions()
    244246{
    245247    CFStringRef assertionName = CFSTR("WebKit LayoutTestHelper");
    246248    CFStringRef assertionDetails = CFSTR("WebKit layout-test helper tool is preventing sleep.");
     249    IOPMAssertionCreateWithDescription(kIOPMAssertionTypePreventUserIdleDisplaySleep,
     250        assertionName, assertionDetails, assertionDetails, NULL, 0, NULL, &assertionIDForDisplaySleep);
    247251    IOPMAssertionCreateWithDescription(kIOPMAssertionTypePreventUserIdleSystemSleep,
    248         assertionName, assertionDetails, assertionDetails, NULL, 0, NULL, &assertionID);
     252        assertionName, assertionDetails, assertionDetails, NULL, 0, NULL, &assertionIDForSystemSleep);
    249253}
    250254
     
    270274    signal(SIGTERM, simpleSignalHandler);
    271275
    272     addDisplaySleepAssertion();
     276    addSleepAssertions();
    273277    lockDownDiscreteGraphics();
    274278
     
    285289    // Restore the profile
    286290    restoreUserColorProfile();
    287     releaseDisplaySleepAssertion();
     291    releaseSleepAssertions();
    288292
    289293    return 0;
Note: See TracChangeset for help on using the changeset viewer.