diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2011-11-02 18:30:18 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2011-11-02 18:30:18 +0000 |
commit | 1204639d4aeeac3d3dda7b0c53b8941266b9e685 (patch) | |
tree | 37db0dee0bdaad00e3c6faf9c50d2c3804b598b6 /UnitTesting/GTMAppKitUnitTestingUtilities.h | |
parent | fe8209a1d04223c70727a4e87cfe53d5bd4192c0 (diff) |
[Author: thomasvl]
- Support for localizing non datasource versions of NSComboxBox (http://code.google.com/p/google-toolbox-for-mac/issues/detail?id=77).
- Fix up some category names.
- Avoid conflicting category names.
- Move placeholder string support down to NSTextField instead of NSSearchField.
- Support for NSTextField placeholder in unittesting state.
- Support for non datasource combobox values in unittesting state.
- Fix NSSegmentControl localization support.
- Add explicit tests for no localized values and document it in the strings file.
- Unittesting for as much as possible of the above.
R=dmaclach
DELTA=762 (660 added, 55 deleted, 47 changed)
Diffstat (limited to 'UnitTesting/GTMAppKitUnitTestingUtilities.h')
-rw-r--r-- | UnitTesting/GTMAppKitUnitTestingUtilities.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/UnitTesting/GTMAppKitUnitTestingUtilities.h b/UnitTesting/GTMAppKitUnitTestingUtilities.h index d29f63a..1edccd7 100644 --- a/UnitTesting/GTMAppKitUnitTestingUtilities.h +++ b/UnitTesting/GTMAppKitUnitTestingUtilities.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -29,7 +29,7 @@ // This should be called in main, before NSApplicationMain is called. + (void)setUpForUIUnitTests; -// Syntactic sugar combining that checks to see if we are running unittests +// Syntactic sugar combining that checks to see if we are running unittests // and then calls setUpForUIUnitTests wrapped up in a NSAutoreleasePool so that // your main can look like this: // int main(int argc, const char *argv[]) { @@ -42,11 +42,11 @@ // the screen saver is active. + (BOOL)isScreenSaverActive; -// Allows for posting either a keydown or a keyup with all the modifiers being -// applied. Passing a 'g' with NSKeyDown and NSShiftKeyMask +// Allows for posting either a keydown or a keyup with all the modifiers being +// applied. Passing a 'g' with NSKeyDown and NSShiftKeyMask // generates two events (a shift key key down and a 'g' key keydown). Make sure -// to balance this with a keyup, or things could get confused. Events get posted -// using the CGRemoteOperation events which means that it gets posted in the +// to balance this with a keyup, or things could get confused. Events get posted +// using the CGRemoteOperation events which means that it gets posted in the // system event queue. Thus you can affect other applications if your app isn't // the active app (or in some cases, such as hotkeys, even if it is). // Arguments: @@ -58,12 +58,12 @@ // cocoaModifiers - an int made up of bit masks. Handles NSAlphaShiftKeyMask, // NSShiftKeyMask, NSControlKeyMask, NSAlternateKeyMask, and // NSCommandKeyMask -+ (void)postKeyEvent:(NSEventType)type - character:(CGCharCode)keyChar ++ (void)postKeyEvent:(NSEventType)type + character:(CGCharCode)keyChar modifiers:(UInt32)cocoaModifiers; // Syntactic sugar for posting a keydown immediately followed by a key up event -// which is often what you really want. +// which is often what you really want. // Arguments: // keyChar - character on the keyboard to type. Make sure it is lower case. // If you need upper case, pass in the NSShiftKeyMask in the @@ -72,20 +72,20 @@ // cocoaModifiers - an int made up of bit masks. Handles NSAlphaShiftKeyMask, // NSShiftKeyMask, NSControlKeyMask, NSAlternateKeyMask, and // NSCommandKeyMask -+ (void)postTypeCharacterEvent:(CGCharCode)keyChar ++ (void)postTypeCharacterEvent:(CGCharCode)keyChar modifiers:(UInt32)cocoaModifiers; @end // Some category methods to simplify spinning the runloops in such a way as // to make tests less flaky, but have them complete as fast as possible. -@interface NSApplication (GTMUnitTestingAdditions) -// Has NSApplication call nextEventMatchingMask repeatedly until -// [context shouldStop] returns YES or it returns nil because the current date +@interface NSApplication (GTMUnitTestingRunAdditions) +// Has NSApplication call nextEventMatchingMask repeatedly until +// [context shouldStop] returns YES or it returns nil because the current date // is greater than |date|. // Return YES if the runloop was stopped because [context shouldStop] returned // YES. -- (BOOL)gtm_runUntilDate:(NSDate *)date +- (BOOL)gtm_runUntilDate:(NSDate *)date context:(id<GTMUnitTestingRunLoopContext>)context; // Calls -gtm_runUntilDate:context: with the timeout date set to 60 seconds. |