Skip to content

merge master #628

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

Merged
merged 10 commits into from
Jan 8, 2018
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
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osx_image: xcode9.1
osx_image: xcode9.2
language: objective-c
cache:
- bundler
Expand All @@ -16,7 +16,9 @@ before_install:
script:
- "! git grep -I ' $'" # Fail on trailing whitespace in non-binary files
- ./test.sh
- bundle exec pod lib lint FirebaseCore.podspec

# TODO fix os_log deprecation warning in FIRLogger to remove --allow-warnings
- bundle exec pod lib lint FirebaseCore.podspec --allow-warnings

# TODO - Uncomment subsequent lines once FirebaseCore source repo is in public Specs repo
# - bundle exec pod lib lint FirebaseAuth.podspec
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ include(external/FirebaseCore)

include(external/googletest)
include(external/leveldb)
include(external/abseil-cpp)
include(external/firestore)
41 changes: 39 additions & 2 deletions Example/Auth/ApiTests/FirebaseAuthApiTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
/** The testing email address for testSignInExistingUserWithEmailAndPassword. */
static NSString *const kExistingTestingEmailToSignIn = @"[email protected]";

/** The testing email address for testUpdatingUsersEmail. */
static NSString *const kNewTestingEmail = @"[email protected]";

/** The testing password for testSignInExistingUserWithModifiedEmailAndPassword. */
static NSString *const kNewTestingPasswordToSignIn = @"password_new";

/** Error message for invalid custom token sign in. */
NSString *kInvalidTokenErrorMessage =
@"The custom token format is incorrect. Please check the documentation.";
Expand All @@ -75,7 +81,7 @@
*/
NSString *kGoogleTestAccountRefreshToken = KGOOGLE_TEST_ACCOUNT_REFRESH_TOKEN;

static NSTimeInterval const kExpectationsTimeout = 30;
static NSTimeInterval const kExpectationsTimeout = 10;

#ifdef NO_NETWORK
#define SKIP_IF_ON_MOBILE_HARNESS \
Expand Down Expand Up @@ -145,6 +151,38 @@ - (void)testCreateAccountWithEmailAndPassword {
[self deleteCurrentFirebaseUser];
}

- (void)testUpdatingUsersEmail {
SKIP_IF_ON_MOBILE_HARNESS
FIRAuth *auth = [FIRAuth auth];
if (!auth) {
XCTFail(@"Could not obtain auth object.");
}

__block NSError *apiError;
XCTestExpectation *expectation =
[self expectationWithDescription:@"Created account with email and password."];
[auth createUserWithEmail:kTestingEmailToCreateUser
password:@"password"
completion:^(FIRUser *user, NSError *error) {
apiError = error;
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kExpectationsTimeout handler:nil];
expectation = [self expectationWithDescription:@"Created account with email and password."];
XCTAssertEqualObjects(auth.currentUser.email, kTestingEmailToCreateUser);
XCTAssertNil(apiError);
[auth.currentUser updateEmail:kNewTestingEmail
completion:^(NSError *_Nullable error) {
apiError = error;
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kExpectationsTimeout handler:nil];
XCTAssertNil(apiError);
XCTAssertEqualObjects(auth.currentUser.email, kNewTestingEmail);
// Clean up the created Firebase user for future runs.
[self deleteCurrentFirebaseUser];
}

- (void)testLinkAnonymousAccountToFacebookAccount {
FIRAuth *auth = [FIRAuth auth];
if (!auth) {
Expand Down Expand Up @@ -293,7 +331,6 @@ - (void)testSignInWithValidCustomAuthExpiredToken {

XCTAssertNil(auth.currentUser);
XCTAssertEqual(apiError.code, FIRAuthErrorCodeInvalidCustomToken);
[NSThread sleepForTimeInterval:3.0];
}

- (void)testInMemoryUserAfterSignOut {
Expand Down
2 changes: 0 additions & 2 deletions Example/Auth/App/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<string>correct_client_id</string>
<key>REVERSED_CLIENT_ID</key>
<string>correct_reversed_client_id</string>
<key>ANDROID_CLIENT_ID</key>
<string>correct_android_client_id</string>
<key>GOOGLE_APP_ID</key>
<string>1:123:ios:123abc</string>
<key>GCM_SENDER_ID</key>
Expand Down
21 changes: 21 additions & 0 deletions Example/Auth/App/tvOS/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2017 Google
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property(strong, nonatomic) UIWindow *window;

@end
63 changes: 63 additions & 0 deletions Example/Auth/App/tvOS/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2017 Google
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

@import FirebaseCore;
@import FirebaseAuth;

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[FIRApp configure];
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for
// certain types of temporary interruptions (such as an incoming phone call or SMS message) or
// when the user quits the application and it begins the transition to the background state. Use
// this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates.
// Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store
// enough application state information to restore your application to its current state in case
// it is terminated later. If your application supports background execution, this method is
// called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the active state; here you can undo
// many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If
// the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also
// applicationDidEnterBackground:.
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"images" : [
{
"idiom" : "tv"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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,17 @@
{
"layers" : [
{
"filename" : "Front.imagestacklayer"
},
{
"filename" : "Middle.imagestacklayer"
},
{
"filename" : "Back.imagestacklayer"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"images" : [
{
"idiom" : "tv"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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,11 @@
{
"images" : [
{
"idiom" : "tv"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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,16 @@
{
"images" : [
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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,17 @@
{
"layers" : [
{
"filename" : "Front.imagestacklayer"
},
{
"filename" : "Middle.imagestacklayer"
},
{
"filename" : "Back.imagestacklayer"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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,16 @@
{
"images" : [
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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,32 @@
{
"assets" : [
{
"size" : "1280x768",
"idiom" : "tv",
"filename" : "App Icon - App Store.imagestack",
"role" : "primary-app-icon"
},
{
"size" : "400x240",
"idiom" : "tv",
"filename" : "App Icon.imagestack",
"role" : "primary-app-icon"
},
{
"size" : "2320x720",
"idiom" : "tv",
"filename" : "Top Shelf Image Wide.imageset",
"role" : "top-shelf-image-wide"
},
{
"size" : "1920x720",
"idiom" : "tv",
"filename" : "Top Shelf Image.imageset",
"role" : "top-shelf-image"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading