aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMUILocalizerAndLayoutTweakerTest.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-09-02 20:30:38 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-09-02 20:30:38 +0000
commit4ee3b1359f5407ad4bb552bcc1c563970d355017 (patch)
tree7a32b511367746f60b003ad9cec7811dbec56d95 /AppKit/GTMUILocalizerAndLayoutTweakerTest.m
parenta8ff4e805f875b8d565df63ad1e9fd56e699b3e1 (diff)
[Author: thomasvl]
Add another window to the UILocalizer unittest that puts a bunch of items into boxes, splitters, and scroll views to make sure they are working. Support some NSBox attributes in AppKit+UnitTesting. Update the size to fit code to only special case regular push buttons and not other types of buttons. Update the expectations due to this change. Add a new unittest to test all button styles and sizes. Update how we decided to do vertical or horizontal layout on a width box because left aligning things is visual and doesn't actually align their frames, so instead we do a rect intersection instead. Added in the CompilerSDK on Mac OS builds to the paths searches. Update the comments on how paths are searched to be correct. R=dmaclach,stuartmorgan DELTA=2709 (2643 added, 8 deleted, 58 changed)
Diffstat (limited to 'AppKit/GTMUILocalizerAndLayoutTweakerTest.m')
-rw-r--r--AppKit/GTMUILocalizerAndLayoutTweakerTest.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/AppKit/GTMUILocalizerAndLayoutTweakerTest.m b/AppKit/GTMUILocalizerAndLayoutTweakerTest.m
index e6320d5..dc75cd0 100644
--- a/AppKit/GTMUILocalizerAndLayoutTweakerTest.m
+++ b/AppKit/GTMUILocalizerAndLayoutTweakerTest.m
@@ -27,6 +27,7 @@ static NSUInteger gTestPass = 0;
@end
@implementation GTMUILocalizerAndLayoutTweakerTest
+
- (void)testWindowLocalization {
// Test with nib 1
for (gTestPass = 0; gTestPass < 3; ++gTestPass) {
@@ -100,6 +101,29 @@ static NSUInteger gTestPass = 0;
}
}
+- (void)testButtonStyleLocalizations {
+ // Since we special case standard push buttons, test all button types.
+
+ // This also tests the vertical vs. horizontal layout code on widthbox, if
+ // you look at the xib in IB, turn on the bounds rectagle display, and you'll
+ // see how IB's left alignment is a visual alignment, it doesn't actually
+ // align the bounds of the views.
+
+ for (gTestPass = 0; gTestPass < 3; ++gTestPass) {
+ GTMUILocalizerAndLayoutTweakerTestWindowController *controller =
+ [[GTMUILocalizerAndLayoutTweakerTestWindowController alloc]
+ initWithWindowNibName:@"GTMUILocalizerAndLayoutTweakerTest4"];
+ NSWindow *window = [controller window];
+ STAssertNotNil(window, @"Pass %ld", (long)gTestPass);
+ NSString *imageName =
+ [NSString stringWithFormat:@"GTMUILocalizerAndLayoutTweakerTest4-%ld",
+ (long)gTestPass];
+ GTMAssertObjectImageEqualToImageNamed(window, imageName,
+ @"Pass %ld", (long)gTestPass);
+ [controller release];
+ }
+}
+
@end
@implementation GTMUILocalizerAndLayoutTweakerTestWindowController