Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Tests No Longer Launch App Fully #7047

Merged
merged 6 commits into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions WordPress/Classes/System/WordPressAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

@interface WordPressAppDelegate : NSObject <UIApplicationDelegate>

@property (nonatomic, strong, readonly) WPAppAnalytics *analytics;
@property (nonatomic, strong, readwrite) IBOutlet UIWindow *window;
@property (nonatomic, strong, readonly) WPLogger *logger;
@property (nonatomic, strong, readonly) Reachability *internetReachability;
@property (nonatomic, strong, readonly) Reachability *wpcomReachability;
@property (nonatomic, assign, readonly) BOOL connectionAvailable;
@property (nonatomic, strong, readonly) WPUserAgent *userAgent;
@property (nonatomic, strong, readonly) WPAppAnalytics *analytics;
@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, strong, readonly) WPLogger *logger;
@property (nonatomic, strong, readonly) Reachability *internetReachability;
@property (nonatomic, strong, readonly) Reachability *wpcomReachability;
@property (nonatomic, assign, readonly) BOOL connectionAvailable;
@property (nonatomic, strong, readonly) WPUserAgent *userAgent;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Okay. Relax. Breathe. It's just lack of alignment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱


+ (WordPressAppDelegate *)sharedInstance;

Expand Down
3 changes: 2 additions & 1 deletion WordPress/Classes/System/WordPressAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ - (void)dealloc

- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

[WordPressAppDelegate fixKeychainAccess];

// Basic networking setup
Expand Down Expand Up @@ -120,7 +122,6 @@ - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
DDLogVerbose(@"didFinishLaunchingWithOptions state: %d", application.applicationState);
[self.window makeKeyAndVisible];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity: Is this actually not needed? instantiating a UIWindow makes it Key and Visible by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jleandroperez We're calling the same method a bit later in this method.


[[InteractiveNotificationsManager sharedInstance] registerForUserNotifications];
[self showWelcomeScreenIfNeededAnimated:NO];
Expand Down
4 changes: 0 additions & 4 deletions WordPress/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@
<string>WordPress would like to add your location to posts on sites where you have enabled geotagging.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>WordPress would like to add your location to posts on sites where you have enabled geotagging.</string>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>NSMainNibFile~ipad</key>
<string>MainWindow-iPad</string>
<key>NSMicrophoneUsageDescription</key>
<string>For your videos to have sound on them.</string>
<key>NSPhotoLibraryUsageDescription</key>
Expand Down
26 changes: 0 additions & 26 deletions WordPress/Resources-iPad/MainWindow-iPad.xib

This file was deleted.

29 changes: 0 additions & 29 deletions WordPress/Resources/MainWindow.xib

This file was deleted.

22 changes: 14 additions & 8 deletions WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
261FF32C1DDCF58900695BD5 /* MediaServiceRemoteRESTTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 261FF32B1DDCF58900695BD5 /* MediaServiceRemoteRESTTests.swift */; };
26A1B5A01DDB6FC1007BDAC0 /* ReaderSiteServiceRemoteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A1B59F1DDB6FC1007BDAC0 /* ReaderSiteServiceRemoteTests.swift */; };
28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; };
2906F812110CDA8900169D56 /* EditCommentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2906F810110CDA8900169D56 /* EditCommentViewController.m */; };
296526FE105810E100597FA3 /* NSString+Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 296526FD105810E100597FA3 /* NSString+Helpers.m */; };
296890780FE971DC00770264 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 296890770FE971DC00770264 /* Security.framework */; };
Expand All @@ -166,7 +165,6 @@
43A85B311E9E815B00FA990B /* Login.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 43A85B301E9E815B00FA990B /* Login.storyboard */; };
43AB7C5E1D3E70510066CB6A /* PostListFilterSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43AB7C5D1D3E70510066CB6A /* PostListFilterSettings.swift */; };
43D54D131DCAA070007F575F /* PostPostViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D54D121DCAA070007F575F /* PostPostViewController.swift */; };
45C73C25113C36F70024D0D2 /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 45C73C24113C36F70024D0D2 /* MainWindow-iPad.xib */; };
462F4E0A18369F0B0028D2F8 /* BlogDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 462F4E0718369F0B0028D2F8 /* BlogDetailsViewController.m */; };
4645AFC51961E1FB005F7509 /* AppImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4645AFC41961E1FB005F7509 /* AppImages.xcassets */; };
5903AE1B19B60A98009D5354 /* WPButtonForNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 5903AE1A19B60A98009D5354 /* WPButtonForNavigationBar.m */; };
Expand Down Expand Up @@ -365,6 +363,9 @@
932645A41E7C206600134988 /* EditorSettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 932645A31E7C206600134988 /* EditorSettingsTests.swift */; };
932AB00B1D526C1400BE486D /* gallery-reader-post-private.json in Resources */ = {isa = PBXBuildFile; fileRef = 932AB00A1D526C1400BE486D /* gallery-reader-post-private.json */; };
932C6CB31D521DFA006E4A62 /* gallery-reader-post-public.json in Resources */ = {isa = PBXBuildFile; fileRef = 932C6CB21D521DFA006E4A62 /* gallery-reader-post-public.json */; };
933D1F471EA64108009FB462 /* TestingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 933D1F461EA64108009FB462 /* TestingAppDelegate.m */; };
933D1F6C1EA7A3AB009FB462 /* TestingMode.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 933D1F6B1EA7A3AB009FB462 /* TestingMode.storyboard */; };
933D1F6E1EA7A402009FB462 /* TestAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 933D1F6D1EA7A402009FB462 /* TestAssets.xcassets */; };
93414DE51E2D25AE003143A3 /* PostEditorState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93414DE41E2D25AE003143A3 /* PostEditorState.swift */; };
934884AB19B73BA6004028D8 /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = B5CC05F51962150600975CAC /* Constants.m */; };
93594BD5191D2F5A0079E6B2 /* stats-batch.json in Resources */ = {isa = PBXBuildFile; fileRef = 93594BD4191D2F5A0079E6B2 /* stats-batch.json */; };
Expand Down Expand Up @@ -1239,7 +1240,6 @@
261FF32B1DDCF58900695BD5 /* MediaServiceRemoteRESTTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaServiceRemoteRESTTests.swift; sourceTree = "<group>"; };
26A1B59F1DDB6FC1007BDAC0 /* ReaderSiteServiceRemoteTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReaderSiteServiceRemoteTests.swift; sourceTree = "<group>"; };
28A0AAE50D9B0CCF005BE974 /* WordPress_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordPress_Prefix.pch; sourceTree = "<group>"; };
28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainWindow.xib; path = Resources/MainWindow.xib; sourceTree = "<group>"; };
2906F80F110CDA8900169D56 /* EditCommentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditCommentViewController.h; sourceTree = "<group>"; };
2906F810110CDA8900169D56 /* EditCommentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditCommentViewController.m; sourceTree = "<group>"; };
292CECFE1027259000BD407D /* SFHFKeychainUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SFHFKeychainUtils.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1289,7 +1289,6 @@
43A85B301E9E815B00FA990B /* Login.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Login.storyboard; sourceTree = "<group>"; };
43AB7C5D1D3E70510066CB6A /* PostListFilterSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostListFilterSettings.swift; sourceTree = "<group>"; };
43D54D121DCAA070007F575F /* PostPostViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostPostViewController.swift; sourceTree = "<group>"; };
45C73C24113C36F70024D0D2 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "Resources-iPad/MainWindow-iPad.xib"; sourceTree = "<group>"; };
462F4E0618369F0B0028D2F8 /* BlogDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlogDetailsViewController.h; sourceTree = "<group>"; };
462F4E0718369F0B0028D2F8 /* BlogDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BlogDetailsViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
4645AFC41961E1FB005F7509 /* AppImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = AppImages.xcassets; path = Resources/AppImages.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1646,6 +1645,10 @@
93267A6019B896CD00997EB8 /* Info-Internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Internal.plist"; sourceTree = "<group>"; };
932AB00A1D526C1400BE486D /* gallery-reader-post-private.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "gallery-reader-post-private.json"; sourceTree = "<group>"; };
932C6CB21D521DFA006E4A62 /* gallery-reader-post-public.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "gallery-reader-post-public.json"; path = "../gallery-reader-post-public.json"; sourceTree = "<group>"; };
933D1F451EA64108009FB462 /* TestingAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestingAppDelegate.h; sourceTree = "<group>"; };
933D1F461EA64108009FB462 /* TestingAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestingAppDelegate.m; sourceTree = "<group>"; };
933D1F6B1EA7A3AB009FB462 /* TestingMode.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = TestingMode.storyboard; sourceTree = "<group>"; };
933D1F6D1EA7A402009FB462 /* TestAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = TestAssets.xcassets; sourceTree = "<group>"; };
93414DE41E2D25AE003143A3 /* PostEditorState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = PostEditorState.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
93460A36189D5091000E26CE /* WordPress 14.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 14.xcdatamodel"; sourceTree = "<group>"; };
934884AC19B78723004028D8 /* WordPressTodayWidget-Internal.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "WordPressTodayWidget-Internal.entitlements"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2910,7 +2913,6 @@
CC098B8116A9EB0400450976 /* HTML */,
B5DCD0C21C69328E00C9B431 /* Settings */,
5D6651461637324000EBDA7D /* Sounds */,
28AD735F0D9D9599002E5188 /* MainWindow.xib */,
B51535D31BBB16AA0029B84B /* Launch Screen.storyboard */,
4645AFC41961E1FB005F7509 /* AppImages.xcassets */,
85ED988717DFA00000090D0B /* Images.xcassets */,
Expand Down Expand Up @@ -3097,7 +3099,6 @@
45C73C23113C36F50024D0D2 /* Resources-iPad */ = {
isa = PBXGroup;
children = (
45C73C24113C36F70024D0D2 /* MainWindow-iPad.xib */,
);
name = "Resources-iPad";
sourceTree = "<group>";
Expand Down Expand Up @@ -4899,6 +4900,10 @@
93E9050619E6F3D8005513C9 /* TestContextManager.m */,
E15618FB16DB8677006532C4 /* UIKitTestHelper.h */,
E15618FC16DB8677006532C4 /* UIKitTestHelper.m */,
933D1F451EA64108009FB462 /* TestingAppDelegate.h */,
933D1F461EA64108009FB462 /* TestingAppDelegate.m */,
933D1F6B1EA7A3AB009FB462 /* TestingMode.storyboard */,
933D1F6D1EA7A402009FB462 /* TestAssets.xcassets */,
);
name = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -5630,7 +5635,6 @@
B5C66B701ACF06CA00F68370 /* NoteBlockHeaderTableViewCell.xib in Resources */,
5D6C4AF61B603CA3005E3C43 /* WPTableViewActivityCell.xib in Resources */,
B5DCD0C41C6932FA00C9B431 /* Languages.json in Resources */,
28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */,
A01C55480E25E0D000D411F2 /* defaultPostTemplate.html in Resources */,
43A85B311E9E815B00FA990B /* Login.storyboard in Resources */,
2FAE97090E33B21600CA8540 /* defaultPostTemplate_old.html in Resources */,
Expand All @@ -5651,7 +5655,6 @@
5DFA7EC81AF814E40072023B /* PageListTableViewCell.xib in Resources */,
B5C66B781ACF073900F68370 /* NoteBlockImageTableViewCell.xib in Resources */,
B5683DB81B6C03810043447C /* NoteTableHeaderView.xib in Resources */,
45C73C25113C36F70024D0D2 /* MainWindow-iPad.xib in Resources */,
5D13FA571AF99C2100F06492 /* PageListSectionHeaderView.xib in Resources */,
B54E1DF21A0A7BAA00807537 /* ReplyTextView.xib in Resources */,
08D499671CDD20450004809A /* Menus.storyboard in Resources */,
Expand Down Expand Up @@ -5735,6 +5738,7 @@
E12BE5EE1C5235DB000FD5CA /* get-me-settings-v1.1.json in Resources */,
FF9839AB1CD39F3D00E85258 /* WordPressOAuthClientSuccess.json in Resources */,
B5EA71301DC293F30083032A /* notifications-mark-as-read.json in Resources */,
933D1F6C1EA7A3AB009FB462 /* TestingMode.storyboard in Resources */,
B5EA71361DC294730083032A /* notifications-load-hash.json in Resources */,
743BF32A1E82CE0700192E40 /* people-delete-viewer-failure.json in Resources */,
E15027621E03E51500B847E3 /* notes-action-push.json in Resources */,
Expand Down Expand Up @@ -5768,6 +5772,7 @@
FF34EEAB1CF480F100F8B38D /* WordPressComRestApiFailThrottled.json in Resources */,
B5EA71381DC294B00083032A /* notifications-load-all.json in Resources */,
59F9C1571B9DCE4E00885CC1 /* get-single-theme-v1.1.json in Resources */,
933D1F6E1EA7A402009FB462 /* TestAssets.xcassets in Resources */,
FFB8DC9C1CE320C700D4D1B7 /* WordPressComRestApiFailInvalidInput.json in Resources */,
B5BC25A41CFCBA6A00F7D8B9 /* people-send-invitation-failure.json in Resources */,
B5EFB1D11B33630C007608A3 /* notifications-settings.json in Resources */,
Expand Down Expand Up @@ -6882,6 +6887,7 @@
BE1071FF1BC75FFA00906AFF /* WPStyleGuide+BlogTests.swift in Sources */,
1702BBE21CF319C600766A33 /* DomainsServiceTests.swift in Sources */,
932645A41E7C206600134988 /* EditorSettingsTests.swift in Sources */,
933D1F471EA64108009FB462 /* TestingAppDelegate.m in Sources */,
B5BC25A01CFCB91800F7D8B9 /* PeopleRemoteTests.swift in Sources */,
85B125411B028E34008A3D95 /* PushAuthenticationManagerTests.swift in Sources */,
93D86B981C691E71003D8E3E /* LocalCoreDataServiceTests.m in Sources */,
Expand Down
1 change: 1 addition & 0 deletions WordPress/WordPressTest/PushNotificationsManagerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ - (void)testBadgeResetNotificationDoesntAttemptToHandleAnyNotificationKind
- (void)testHelpshiftNotificationIsProperlyHandled
{
NSDictionary *userInfo = @{ @"origin" : @"helpshift" };
[HelpshiftCore initializeWithProvider:[HelpshiftSupport sharedInstance]];
PushNotificationsManager *manager = [PushNotificationsManager new];
id mockManager = OCMPartialMock(manager);

Expand Down
6 changes: 6 additions & 0 deletions WordPress/WordPressTest/TestAssets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "wapuu-dev.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions WordPress/WordPressTest/TestingAppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <UIKit/UIKit.h>

@interface TestingAppDelegate : NSObject<UIApplicationDelegate>

@property (nonatomic, strong) UIWindow *window;

@end
Loading