Added failing iPhone 6/6 Plus tests.

This commit is contained in:
Shazron Abdullah
2014-09-30 16:59:47 -07:00
parent 95f407ea0d
commit 0ffe1c2d46
4 changed files with 76 additions and 14 deletions
@@ -23,6 +23,8 @@
#import "CDVSplashScreen.h"
#import "ImageNameTestDelegates.h"
const CDV_iOSDevice CDV_iOSDeviceZero = { 0, 0, 0, 0, 0, 0 };
@interface ImageNameTest : XCTestCase
@property (nonatomic, strong) CDVSplashScreen* plugin;
@@ -32,7 +34,7 @@
@interface CDVSplashScreen ()
// expose private interface
- (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id<CDVScreenOrientationDelegate>)orientationDelegate isIPad:(BOOL)isIPad isIPhone5:(BOOL)isIPhone5;
- (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id<CDVScreenOrientationDelegate>)orientationDelegate device:(CDV_iOSDevice)device;
@end
@@ -53,35 +55,64 @@
- (void) portraitHelper:(UIInterfaceOrientation)initialOrientation delegate:(id<CDVScreenOrientationDelegate>)delegate
{
NSString* name = nil;
CDV_iOSDevice device;
// Portrait, non-iPad, non-iPhone5
name = [self.plugin getImageName:initialOrientation delegate:delegate isIPad:NO isIPhone5:NO];
device = CDV_iOSDeviceZero; device.iPad = NO; device.iPhone5 = NO;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default" isEqualToString:name], @"Portrait - 3.5\" iPhone failed (%@)", name);
// Portrait, iPad, non-iPhone5
name = [self.plugin getImageName:initialOrientation delegate:delegate isIPad:YES isIPhone5:NO];
device = CDV_iOSDeviceZero; device.iPad = YES; device.iPhone5 = NO;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default-Portrait" isEqualToString:name], @"Portrait - iPad failed (%@)", name);
// Portrait, non-iPad, iPhone5
name = [self.plugin getImageName:initialOrientation delegate:delegate isIPad:NO isIPhone5:YES];
device = CDV_iOSDeviceZero; device.iPad = NO; device.iPhone5 = YES;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default-568h" isEqualToString:name], @"Portrait - iPhone 5 failed (%@)", name);
// Portrait, non-iPad, iPhone6
device = CDV_iOSDeviceZero; device.iPad = NO; device.iPhone6 = YES;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default-667h" isEqualToString:name], @"Portrait - iPhone 6 failed (%@)", name);
// Portrait, non-iPad, iPhone6Plus
device = CDV_iOSDeviceZero; device.iPad = NO; device.iPhone6Plus = YES;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default-736h" isEqualToString:name], @"Portrait - iPhone 6Plus failed (%@)", name);
}
- (void) landscapeHelper:(UIInterfaceOrientation)initialOrientation delegate:(id<CDVScreenOrientationDelegate>)delegate
{
NSString* name = nil;
CDV_iOSDevice device;
// Landscape, non-iPad, non-iPhone5 (does NOT support landscape)
name = [self.plugin getImageName:initialOrientation delegate:delegate isIPad:NO isIPhone5:NO];
device = CDV_iOSDeviceZero; device.iPad = NO; device.iPhone5 = NO;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default" isEqualToString:name], @"Landscape - 3.5\" iPhone failed (%@)", name );
// Landscape, iPad, non-iPhone5 (supports landscape)
name = [self.plugin getImageName:initialOrientation delegate:delegate isIPad:YES isIPhone5:NO];
device = CDV_iOSDeviceZero; device.iPad = YES; device.iPhone5 = NO;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default-Landscape" isEqualToString:name], @"Landscape - iPad failed (%@)", name);
// Landscape, non-iPad, iPhone5 (does NOT support landscape)
name = [self.plugin getImageName:initialOrientation delegate:delegate isIPad:NO isIPhone5:YES];
device = CDV_iOSDeviceZero; device.iPad = NO; device.iPhone5 = YES;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default-568h" isEqualToString:name], @"Landscape - iPhone5 failed (%@)", name);
// Landscape, non-iPad, iPhone6 (does NOT support landscape)
device = CDV_iOSDeviceZero; device.iPad = NO; device.iPhone6 = YES;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default-667h" isEqualToString:name], @"Landscape - iPhone6 failed (%@)", name);
// Landscape, non-iPad, iPhone6Plus (does support landscape)
device = CDV_iOSDeviceZero; device.iPad = NO; device.iPhone6Plus = YES;
name = [self.plugin getImageName:initialOrientation delegate:delegate device:device];
XCTAssertTrue([@"Default-Landscape-736h" isEqualToString:name], @"Landscape - iPhone6Plus failed (%@)", name);
}
- (void)testPortraitOnly {
@@ -57,8 +57,8 @@
7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCDVSplashScreenLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDVSplashScreenLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7E9F51A219DA102000DA31AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVSplashScreen.m; path = ../../../../src/ios/CDVSplashScreen.m; sourceTree = "<group>"; };
7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVSplashScreen.h; path = ../../../../src/ios/CDVSplashScreen.h; sourceTree = "<group>"; };
7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVSplashScreen.m; path = ../../../src/ios/CDVSplashScreen.m; sourceTree = SOURCE_ROOT; };
7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVSplashScreen.h; path = ../../../src/ios/CDVSplashScreen.h; sourceTree = SOURCE_ROOT; };
7E9F51B019DA114400DA31AC /* ImageNameTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageNameTest.m; sourceTree = "<group>"; };
7E9F51B219DA116500DA31AC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
7E9F51B419DA127E00DA31AC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
@@ -124,7 +124,7 @@
7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */,
);
path = CDVSplashScreenLib;
sourceTree = "<group>";
sourceTree = SOURCE_ROOT;
};
7E9F51A019DA102000DA31AC /* CDVSplashScreenLibTests */ = {
isa = PBXGroup;