-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #293 from samtstern/master
Version 0.5.3
- Loading branch information
Showing
10 changed files
with
69 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
auth/src/test/java/com/firebase/ui/auth/test_helpers/LoginManagerShadow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.firebase.ui.auth.test_helpers; | ||
|
||
import android.app.Activity; | ||
|
||
import com.facebook.CallbackManager; | ||
import com.facebook.FacebookCallback; | ||
import com.facebook.login.LoginManager; | ||
import com.facebook.login.LoginResult; | ||
|
||
import org.robolectric.annotation.Implementation; | ||
import org.robolectric.annotation.Implements; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* Shadow for Facebook SDK {@link LoginManager}. | ||
*/ | ||
@Implements(LoginManager.class) | ||
public class LoginManagerShadow { | ||
|
||
private FacebookCallback<LoginResult> mCallback; | ||
|
||
@Implementation | ||
public void registerCallback(final CallbackManager callbackManager, | ||
final FacebookCallback<LoginResult> callback) { | ||
mCallback = callback; | ||
} | ||
|
||
@Implementation | ||
public void logInWithReadPermissions(Activity activity, Collection<String> permissions) { | ||
// Check for minimum permission set | ||
if (!(permissions.contains("email") && permissions.contains("public_profile"))) { | ||
throw new IllegalArgumentException("Facebook permissions must contain email and " + | ||
"public_profile."); | ||
} | ||
|
||
// Call back with success | ||
mCallback.onSuccess(null); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters