Changeset 196212 in webkit
- Timestamp:
- Feb 5, 2016 11:00:56 PM (8 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r196189 r196212 1 2016-02-05 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 (addDisplaySleepAssertion): Add the assertion so that the display doesn't turn off. 10 (releaseDisplaySleepAssertion): Release the DisplaySleep Assertion. 11 (simpleSignalHandler): Release the DisplaySleepAssertion in case of any iterrupt. 12 1 13 2016-02-05 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/Tools/DumpRenderTree/mac/LayoutTestHelper.m
r189639 r196212 34 34 #import <AppKit/AppKit.h> 35 35 #import <ApplicationServices/ApplicationServices.h> 36 #import <IOKit/pwr_mgt/IOPMLib.h> 36 37 #import <getopt.h> 37 38 #import <signal.h> … … 45 46 46 47 static int installColorProfile = false; 48 static uint32_t assertionID = 0; 47 49 48 50 static NSMutableDictionary *originalColorProfileURLs() … … 192 194 } 193 195 196 static void releaseDisplaySleepAssertion() 197 { 198 IOPMAssertionRelease(assertionID); 199 } 200 194 201 static void simpleSignalHandler(int sig) 195 202 { 196 203 // Try to restore the color profile and try to go down cleanly 197 204 restoreUserColorProfile(); 205 releaseDisplaySleepAssertion(); 198 206 exit(128 + sig); 199 207 } … … 229 237 if (kernResult != KERN_SUCCESS) 230 238 NSLog(@"IOObjectRelease() failed in %s with kernResult = %d", __FUNCTION__, kernResult); 239 } 240 241 void addDisplaySleepAssertion() 242 { 243 CFStringRef assertionName = CFSTR("WebKit LayoutTestHelper"); 244 CFStringRef assertionDetails = CFSTR("WebKit layout-test helper tool is preventing sleep."); 245 IOPMAssertionCreateWithDescription(kIOPMAssertionTypePreventUserIdleDisplaySleep, 246 assertionName, assertionDetails, assertionDetails, NULL, 0, NULL, &assertionID); 231 247 } 232 248 … … 252 268 signal(SIGTERM, simpleSignalHandler); 253 269 270 addDisplaySleepAssertion(); 254 271 lockDownDiscreteGraphics(); 255 272 … … 266 283 // Restore the profile 267 284 restoreUserColorProfile(); 285 releaseDisplaySleepAssertion(); 268 286 269 287 return 0;
Note: See TracChangeset
for help on using the changeset viewer.