diff options
author | thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2008-04-14 17:21:02 +0000 |
---|---|---|
committer | thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2008-04-14 17:21:02 +0000 |
commit | cdf070c8d76ffc4eaa24e8671756cbbe9ceb2890 (patch) | |
tree | faa9ae3a72a6591d6a6add7ceed7f91e92ade11f /AppKit/GTMNSWorkspace+ScreenSaver.m | |
parent | 0aaecac6ff2bc89e58a0c8c6d6ad62e02fb2b011 (diff) |
See the ReleaseNotes for the full details, highlights:
- bug fixes
- code coverage support
- more complete unittests
- full support for unittesting UIs
- support for the iphone sdk (include ui unittesting)
Diffstat (limited to 'AppKit/GTMNSWorkspace+ScreenSaver.m')
-rw-r--r-- | AppKit/GTMNSWorkspace+ScreenSaver.m | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/AppKit/GTMNSWorkspace+ScreenSaver.m b/AppKit/GTMNSWorkspace+ScreenSaver.m index 270f9bc..c86a73c 100644 --- a/AppKit/GTMNSWorkspace+ScreenSaver.m +++ b/AppKit/GTMNSWorkspace+ScreenSaver.m @@ -19,6 +19,7 @@ #import <Carbon/Carbon.h> #import <ScreenSaver/ScreenSaver.h> #import "GTMNSWorkspace+ScreenSaver.h" +#import "GTMDefines.h" // Interesting class descriptions extracted from ScreenSaver.framework using // class-dump. Note that these are "not documented". @@ -79,21 +80,25 @@ // step rather carefully. Class screenSaverControllerClass = NSClassFromString(@"ScreenSaverController"); - NSAssert(screenSaverControllerClass, - @"Are you linked with ScreenSaver.framework?" - " Can't find ScreenSaverController class."); + _GTMDevAssert(screenSaverControllerClass, + @"Are you linked with ScreenSaver.framework?" + " Can't find ScreenSaverController class."); if ([screenSaverControllerClass respondsToSelector:@selector(controller)]) { controller = [ScreenSaverController controller]; if (controller) { if ([controller respondsToSelector:@selector(screenSaverIsRunning)]) { answer = [controller screenSaverIsRunning]; } else { - NSLog(@"ScreenSaverController no longer supports -screenSaverIsRunning?"); + // COV_NF_START + _GTMDevLog(@"ScreenSaverController no longer supports -screenSaverIsRunning?"); + controller = nil; + // COV_NF_END } } } if (!controller) { + // COV_NF_START // If we can't get the controller, chances are we are being run from the // command line and don't have access to the window server. As such we are // going to fallback to the older method of figuring out if a screen saver @@ -106,7 +111,7 @@ = ProcessInformationCopyDictionary(&psn, kProcessDictionaryIncludeAllInformationMask); - require(cfProcessInfo, CantGetFrontProcessInfo); + require(cfProcessInfo, CantGetFrontProcess); NSString *bundlePath = [(NSDictionary*)cfProcessInfo objectForKey:@"BundlePath"]; @@ -116,8 +121,8 @@ answer = [bundlePath hasSuffix:@"ScreenSaverEngine.app"] || [bundlePath hasSuffix:@"SecurityAgent.app"]; CFRelease(cfProcessInfo); + // COV_NF_END } -CantGetFrontProcessInfo: CantGetFrontProcess: return answer; } |