forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1139677 - Display the user's FxA profile image in the Sync Pref p…
…ane r=markh,rfeeley
- Loading branch information
Showing
9 changed files
with
144 additions
and
41 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
12 changes: 12 additions & 0 deletions
12
browser/themes/shared/incontentprefs/default-profile-image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -923,7 +923,6 @@ add_test(function test_getSignedInUserProfile_ok() { | |
fxa.getSignedInUserProfile() | ||
.then(result => { | ||
do_check_eq(result.avatar, "image"); | ||
do_check_true(result.verified); | ||
run_next_test(); | ||
}); | ||
}); | ||
|
@@ -946,34 +945,40 @@ add_test(function test_getSignedInUserProfile_error_uses_account_data() { | |
}; | ||
|
||
fxa.getSignedInUserProfile() | ||
.then(result => { | ||
do_check_eq(typeof result.avatar, "undefined"); | ||
do_check_eq(result.email, "[email protected]"); | ||
.catch(error => { | ||
do_check_eq(error.message, "UNKNOWN_ERROR"); | ||
run_next_test(); | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
add_test(function test_getSignedInUserProfile_no_account_data() { | ||
add_test(function test_getSignedInUserProfile_unverified_account() { | ||
let fxa = new MockFxAccounts(); | ||
let alice = getTestUser("alice"); | ||
|
||
fxa.internal.getSignedInUser = function () { | ||
return Promise.resolve({ email: "[email protected]" }); | ||
}; | ||
fxa.setSignedInUser(alice).then(() => { | ||
let accountState = fxa.internal.currentAccountState; | ||
|
||
let accountState = fxa.internal.currentAccountState; | ||
accountState.getProfile = function () { | ||
return Promise.reject("boom"); | ||
}; | ||
fxa.getSignedInUserProfile() | ||
.catch(error => { | ||
do_check_eq(error.message, "UNVERIFIED_ACCOUNT"); | ||
run_next_test(); | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
add_test(function test_getSignedInUserProfile_no_account_data() { | ||
let fxa = new MockFxAccounts(); | ||
|
||
fxa.internal.getSignedInUser = function () { | ||
return Promise.resolve(null); | ||
}; | ||
|
||
fxa.getSignedInUserProfile() | ||
.then(result => { | ||
do_check_eq(result, null); | ||
.catch(error => { | ||
do_check_eq(error.message, "NO_ACCOUNT"); | ||
run_next_test(); | ||
}); | ||
|
||
|