Skip to content

Commit

Permalink
Merge branch 'master' into NEW--CPTextView
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogild committed Jul 7, 2015
2 parents 2cb6ddf + 6fe9dae commit 88aafec
Show file tree
Hide file tree
Showing 47 changed files with 286 additions and 69 deletions.
14 changes: 9 additions & 5 deletions Tests/AppKit/CPAnimationTest.j
@@ -1,8 +1,6 @@
@import <AppKit/CPApplication.j>
@import <AppKit/CPAnimation.j>

[CPApplication sharedApplication];

@implementation CPAnimation (TestMethods)
{
}
Expand All @@ -18,11 +16,17 @@
{
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)testScheduleTimerWithIntervalBasedOnDefaultFrameRate
{
var animation = [[CPAnimation alloc] initWithDuration:0.1 animationCurve:CPAnimationLinear];
[animation startAnimation];

[self assert:1.0/60.0 equals:[[animation timer] timeInterval]];
}

Expand All @@ -31,7 +35,7 @@
var animation = [[CPAnimation alloc] initWithDuration:0.1 animationCurve:CPAnimationLinear];
[animation setFrameRate:30];
[animation startAnimation];

[self assert:1.0/30.0 equals:[[animation timer] timeInterval]];
}

Expand All @@ -40,7 +44,7 @@
var animation = [[CPAnimation alloc] initWithDuration:0.1 animationCurve:CPAnimationLinear];
[animation setFrameRate:0];
[animation startAnimation];

[self assert:0.0001 equals:[[animation timer] timeInterval]];
}

Expand Down
6 changes: 6 additions & 0 deletions Tests/AppKit/CPApplicationTest.j
Expand Up @@ -61,6 +61,12 @@ var globalResults = [];
CPWindow aWindow;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
// This sets up the CPApp convenience variable, the unit tests fails
Expand Down
9 changes: 9 additions & 0 deletions Tests/AppKit/CPArrayControllerPerformance.j
Expand Up @@ -6,6 +6,15 @@ var ELEMENTS = 200,
REPEATS = 25;

@implementation CPArrayControllerPerformance : OJTestCase
{

}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (CPArrayController)setupWithElements:(int)aCount
{
Expand Down
6 changes: 6 additions & 0 deletions Tests/AppKit/CPArrayControllerTest.j
Expand Up @@ -18,6 +18,12 @@
CPArray depValues @accessors;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (CPArray)makeTestArray
{
return [[Employee employeeWithName:@"Francisco" department:[Department departmentWithName:@"Cappuccino"]],
Expand Down
9 changes: 6 additions & 3 deletions Tests/AppKit/CPAutosizePerformance.j
@@ -1,15 +1,18 @@
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>

[CPApplication sharedApplication];


@implementation CPAutosizePerformance : OJTestCase
{
CPInteger NUMBER_OF_VIEWS;
CPInteger RESIZES_COUNT;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
NUMBER_OF_VIEWS = 50;
Expand Down
7 changes: 6 additions & 1 deletion Tests/AppKit/CPBrowserTest.j
Expand Up @@ -2,13 +2,18 @@

@class CPBrowserDelegate


@implementation CPBrowserTest : OJTestCase
{
CPBrowser browser;
CPBrowserDelegate delegate;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
browser = [[CPBrowser alloc] initWithFrame:CGRectMake(0, 0, 500, 300)];
Expand Down
9 changes: 6 additions & 3 deletions Tests/AppKit/CPButtonTest.j
@@ -1,16 +1,19 @@

@import <AppKit/CPButton.j>
@import <AppKit/CPApplication.j>
@import <AppKit/CPText.j>

[CPApplication sharedApplication];

@implementation CPButtonTest : OJTestCase
{
CPButton button;
BOOL wasClicked;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
button = [CPButton buttonWithTitle:"hello world"];
Expand Down
8 changes: 6 additions & 2 deletions Tests/AppKit/CPCheckBoxTest.j
@@ -1,11 +1,15 @@
@import <AppKit/CPCheckBox.j>

[CPApplication sharedApplication]

@implementation CPCheckBoxTest : OJTestCase
{
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

/*!
Verify that CPCheckBox placeholders work, both explicit and default ones.
*/
Expand Down
6 changes: 6 additions & 0 deletions Tests/AppKit/CPCollectionViewTest.j
Expand Up @@ -7,6 +7,12 @@
id _globalResults;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
_collectionView = [[CPCollectionView alloc] initWithFrame:CGRectMakeZero()];
Expand Down
6 changes: 6 additions & 0 deletions Tests/AppKit/CPColorTest.j
Expand Up @@ -4,6 +4,12 @@
{
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)testHexStringConversion
{
var colors = ['000000', '0099CC', '7E8EAB', 'FFFFFF'];
Expand Down
8 changes: 6 additions & 2 deletions Tests/AppKit/CPColorWellTest.j
@@ -1,13 +1,17 @@
@import <AppKit/CPColorWell.j>
@import <AppKit/CPApplication.j>

[CPApplication sharedApplication];

@implementation CPColorWellTest : OJTestCase
{
CPColorWell colorWell;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
colorWell = [[CPColorWell alloc] initWithFrame:CGRectMakeZero()];
Expand Down
8 changes: 6 additions & 2 deletions Tests/AppKit/CPComboBoxTest.j
Expand Up @@ -4,14 +4,18 @@

@import "CPNotificationCenterHelper.j"

[CPApplication sharedApplication];

@implementation CPComboBoxTest : OJTestCase
{
CPComboBox comboBox;
BOOL wasClicked
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
comboBox = [[CPComboBox alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
Expand Down
6 changes: 6 additions & 0 deletions Tests/AppKit/CPDOMDisplayServerTest.j
Expand Up @@ -8,6 +8,12 @@
BOOL aTransform;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
// set up a dummy DOM element.
Expand Down
7 changes: 6 additions & 1 deletion Tests/AppKit/CPDatePickerTest.j
Expand Up @@ -4,13 +4,18 @@
@import <AppKit/CPApplication.j>
@import <Foundation/Foundation.j>

[CPApplication sharedApplication];

@implementation CPDatePickerTest : OJTestCase
{
CPDatePicker datePicker;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
datePicker = [[CPDatePicker alloc] initWithFrame:CGRectMake(200, 28, 0, 0)];
Expand Down
6 changes: 3 additions & 3 deletions Tests/AppKit/CPEventTest.j
Expand Up @@ -5,10 +5,10 @@
{
}

- (void)setUp
+ (void)setUp
{
// CPApplication must be initialised for some event handling to work.
[CPApplication sharedApplication];
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

/*!
Expand Down
8 changes: 6 additions & 2 deletions Tests/AppKit/CPFontManagerTest.j
@@ -1,7 +1,5 @@
@import <AppKit/AppKit.j>

[CPApplication sharedApplication];

@implementation CPFontManagerTest : OJTestCase
{
CPFont fontA;
Expand All @@ -12,6 +10,12 @@
int tag @accessors;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
fontA = [CPFont systemFontOfSize:8.0];
Expand Down
6 changes: 6 additions & 0 deletions Tests/AppKit/CPFontTest.j
Expand Up @@ -9,6 +9,12 @@
CPFont _boldCustomFont;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
_systemFont = [CPFont systemFontOfSize:15];
Expand Down
6 changes: 6 additions & 0 deletions Tests/AppKit/CPImageTest.j
Expand Up @@ -4,6 +4,12 @@
{
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)testInitWithContentsOfFile_nil
{
var image = [[CPImage alloc] initWithContentsOfFile:nil];
Expand Down
11 changes: 9 additions & 2 deletions Tests/AppKit/CPKeyEquivalentPerformance.j
Expand Up @@ -3,9 +3,16 @@
@import <AppKit/CPEvent.j>
@import <AppKit/CPButton.j>

[CPApplication sharedApplication];

@implementation CPKeyEquivalentPerformance : OJTestCase
{

}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)testKeyEquivalentSpeed
{
Expand Down
9 changes: 6 additions & 3 deletions Tests/AppKit/CPKeyValueBindingSimpleBindingsTest.j
Expand Up @@ -18,11 +18,14 @@
CPObjectController objectController @accessors;
}

- (void)setUp
+ (void)setUp
{
// CPApp must be initialised or action sending will not work.
[CPApplication sharedApplication];
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)setUp
{
track = [Track new];
[track setVolume:5.0];
}
Expand Down
6 changes: 6 additions & 0 deletions Tests/AppKit/CPKeyValueBindingTest.j
Expand Up @@ -21,6 +21,12 @@
CPArrayController arrayController @accessors;
}

+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}

- (void)testExposingBindings
{
[BindingTester exposeBinding:@"foo"];
Expand Down

0 comments on commit 88aafec

Please sign in to comment.