aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMFadeTruncatingTextFieldCellTest.m
diff options
context:
space:
mode:
Diffstat (limited to 'AppKit/GTMFadeTruncatingTextFieldCellTest.m')
-rw-r--r--AppKit/GTMFadeTruncatingTextFieldCellTest.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/AppKit/GTMFadeTruncatingTextFieldCellTest.m b/AppKit/GTMFadeTruncatingTextFieldCellTest.m
index d3f328f..5957269 100644
--- a/AppKit/GTMFadeTruncatingTextFieldCellTest.m
+++ b/AppKit/GTMFadeTruncatingTextFieldCellTest.m
@@ -31,6 +31,7 @@
NSMakeRect(0, 0, 100, 16)] autorelease];
[field setCell:[[[GTMFadeTruncatingTextFieldCell alloc] initTextCell:@""]
autorelease]];
+
[field setStringValue:@"A very long string that won't fit"];
GTMAssertObjectImageEqualToImageNamed(field,
@"GTMFadeTruncatingTextFieldCellTest1",
@@ -39,6 +40,22 @@
GTMAssertObjectImageEqualToImageNamed(field,
@"GTMFadeTruncatingTextFieldCellTest2",
nil);
+
+ // Dark background, light text (force the background to draw (which is odd
+ // for a text cell), but this is to make sure the support for light on dark
+ // is tested.
+ [field setTextColor:[NSColor whiteColor]];
+ [field setDrawsBackground:YES];
+ [field setBackgroundColor:[NSColor blackColor]];
+
+ [field setStringValue:@"A very long string that won't fit"];
+ GTMAssertObjectImageEqualToImageNamed(field,
+ @"GTMFadeTruncatingTextFieldCellTest3",
+ nil);
+ [field setStringValue:@"A short string"];
+ GTMAssertObjectImageEqualToImageNamed(field,
+ @"GTMFadeTruncatingTextFieldCellTest4",
+ nil);
}
@end