Title: [183488] trunk/Tools
Revision
183488
Author
a...@apple.com
Date
2015-04-28 10:44:55 -0700 (Tue, 28 Apr 2015)

Log Message

Disable App Nap in WebKitTestRunner UI process
https://bugs.webkit.org/show_bug.cgi?id=144308

Reviewed by Daniel Bates.

* WebKitTestRunner/mac/main.mm:
(disableAppNapInUIProcess):
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (183487 => 183488)


--- trunk/Tools/ChangeLog	2015-04-28 17:38:45 UTC (rev 183487)
+++ trunk/Tools/ChangeLog	2015-04-28 17:44:55 UTC (rev 183488)
@@ -1,3 +1,14 @@
+2015-04-28  Alexey Proskuryakov  <a...@apple.com>
+
+        Disable App Nap in WebKitTestRunner UI process
+        https://bugs.webkit.org/show_bug.cgi?id=144308
+
+        Reviewed by Daniel Bates.
+
+        * WebKitTestRunner/mac/main.mm:
+        (disableAppNapInUIProcess):
+        (main):
+
 2015-04-28  Marcos Chavarría Teijeiro  <chavarria1...@gmail.com>
 
         [GTK] Update JHBuild Mesa download directory

Modified: trunk/Tools/WebKitTestRunner/mac/main.mm (183487 => 183488)


--- trunk/Tools/WebKitTestRunner/mac/main.mm	2015-04-28 17:38:45 UTC (rev 183487)
+++ trunk/Tools/WebKitTestRunner/mac/main.mm	2015-04-28 17:44:55 UTC (rev 183488)
@@ -39,11 +39,19 @@
     [[NSUserDefaults standardUserDefaults] setValuesForKeysWithDictionary:dict];
 }
 
+static void disableAppNapInUIProcess()
+{
+    NSActivityOptions options = (NSActivityUserInitiatedAllowingIdleSystemSleep | NSActivityLatencyCritical) & ~(NSActivitySuddenTerminationDisabled | NSActivityAutomaticTerminationDisabled);
+    static id assertion = [[[NSProcessInfo processInfo] beginActivityWithOptions:options reason:@"WebKitTestRunner should not be subject to process suppression"] retain];
+    ASSERT_UNUSED(assertion, assertion);
+}
+
 int main(int argc, const char* argv[])
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     [NSApplication sharedApplication];
     setDefaultsToConsistentValuesForTesting();
+    disableAppNapInUIProcess(); // For secondary processes, app nap is disabled using WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled().
 
     {
         WTR::TestController controller(argc, argv);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to