From 6cfa11a94db1402f5d642d38ebc708c4f5e7013d Mon Sep 17 00:00:00 2001 From: aburkhalter Date: Thu, 18 Mar 2010 16:43:01 -0700 Subject: [PATCH] Initial boilerplate and file for putting the untested (at least not directly) CPView.j under test. Initial test to confirm we can actually create the object and a test demonstrating issue #562. --- Tests/AppKit/CPViewTest.j | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Tests/AppKit/CPViewTest.j diff --git a/Tests/AppKit/CPViewTest.j b/Tests/AppKit/CPViewTest.j new file mode 100644 index 000000000..9425ce9f4 --- /dev/null +++ b/Tests/AppKit/CPViewTest.j @@ -0,0 +1,45 @@ + +@import +@import + +[CPApplication sharedApplication] + +@implementation CPViewTest : OJTestCase +{ + CPView view; +} + +- (void)setUp +{ + view = [[CPView alloc] initWithFrame:CGRectMakeZero()]; + [super setUp]; +} + +- (void)testCanCreate +{ + [self assertTrue:!!view]; +} + +/* + During the layout process for the view, _CPImageAndTextView.j throws + a ReferenceError with the following: + + "hasDOMImageElement" is not defined + + The referenced variable is #if PLATFORM(DOM) excluded in all other + instances. While not isolated to the behaviour of a CPView alone, the + following test ensures that pending actions in the _CPDisplayServer can + be flushed without touching unimplemented portions of the test platform + (e.g. the DOM). There are times where we want to confirm that some setting + requiring relayout (e.g. string truncation based on available space), the + following test should help ensure those types of tests are safe to carry + out with ojunit. + + Demonstrates issue #562. +*/ +- (void)testCanFlushPendingLayoutWork +{ + [self assert:undefined same:[_CPDisplayServer run]]; +} + +@end