aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMUILocalizerAndLayoutTweakerTest.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-02-08 19:04:28 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-02-08 19:04:28 +0000
commit0ad6a06b880fa094724e13103a03fbdaae6dd397 (patch)
treefdba5ebcf7612e7c4a33f96b6e0def169f795feb /AppKit/GTMUILocalizerAndLayoutTweakerTest.m
parentfbe9ecbdefae58a6ba0bb3f23a7a3d6c23ecfcf4 (diff)
[Author: thomasvl]
Add basic support for NSTabView and a unittest to validate simple behaviors. R=dmaclach DELTA=1069 (1066 added, 0 deleted, 3 changed)
Diffstat (limited to 'AppKit/GTMUILocalizerAndLayoutTweakerTest.m')
-rw-r--r--AppKit/GTMUILocalizerAndLayoutTweakerTest.m44
1 files changed, 43 insertions, 1 deletions
diff --git a/AppKit/GTMUILocalizerAndLayoutTweakerTest.m b/AppKit/GTMUILocalizerAndLayoutTweakerTest.m
index 5d2375f..fed8359 100644
--- a/AppKit/GTMUILocalizerAndLayoutTweakerTest.m
+++ b/AppKit/GTMUILocalizerAndLayoutTweakerTest.m
@@ -129,7 +129,7 @@ static NSUInteger gTestPass = 0;
}
}
-- (void)testWrapStartTitleForWidth {
+- (void)testWrappingForWidth {
NSString *kTestStrings[] = {
@"The fox jumps the dog.",
@"The quick brown fox jumps over the lazy dog.",
@@ -174,9 +174,51 @@ static NSUInteger gTestPass = 0;
}
}
+- (void)testTabViewLocalization {
+ // Test with nib 6
+ for (gTestPass = 0; gTestPass < 3; ++gTestPass) {
+ GTMUILocalizerAndLayoutTweakerTestWindowController *controller =
+ [[GTMUILocalizerAndLayoutTweakerTestWindowController alloc]
+ initWithWindowNibName:@"GTMUILocalizerAndLayoutTweakerTest6"];
+ NSWindow *window = [controller window];
+ STAssertNotNil(window, @"Pass %zu", gTestPass);
+ NSTabView *tabView = [controller tabView];
+ for (NSInteger tabIndex = 0; tabIndex < [tabView numberOfTabViewItems];
+ ++tabIndex) {
+ [tabView selectTabViewItemAtIndex:tabIndex];
+ NSString *imageName =
+ [NSString stringWithFormat:
+ @"GTMUILocalizerAndLayoutTweakerTest6-tab%ld-%ld",
+ (long)tabIndex, (long)gTestPass];
+ GTMAssertObjectImageEqualToImageNamed(window, imageName,
+ @"Pass %zu", gTestPass);
+ }
+ [controller release];
+ }
+ // Test with nib 2
+ for (gTestPass = 0; gTestPass < 3; ++gTestPass) {
+ GTMUILocalizerAndLayoutTweakerTestWindowController *controller =
+ [[GTMUILocalizerAndLayoutTweakerTestWindowController alloc]
+ initWithWindowNibName:@"GTMUILocalizerAndLayoutTweakerTest2"];
+ NSWindow *window = [controller window];
+ STAssertNotNil(window, @"Pass %zu", gTestPass);
+ NSString *imageName =
+ [NSString stringWithFormat:@"GTMUILocalizerAndLayoutTweakerTest2-%ld",
+ (long)gTestPass];
+ GTMAssertObjectImageEqualToImageNamed(window, imageName,
+ @"Pass %zu", gTestPass);
+ [controller release];
+ }
+}
+
@end
@implementation GTMUILocalizerAndLayoutTweakerTestWindowController
+
+- (NSTabView *)tabView {
+ return tabView_;
+}
+
@end
@implementation GTMUILocalizerAndLayoutTweakerTestLocalizer