From 4ee3b1359f5407ad4bb552bcc1c563970d355017 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 2 Sep 2009 20:30:38 +0000 Subject: [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) --- AppKit/GTMUILocalizerAndLayoutTweakerTest.m | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'AppKit/GTMUILocalizerAndLayoutTweakerTest.m') 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 -- cgit v1.2.3