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.
merge fx-team to mozilla-central a=merge
- Loading branch information
Showing
68 changed files
with
1,639 additions
and
709 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
/* global Services, Assert */ | ||
|
||
const kGuestKeyPref = "loop.key"; | ||
const kFxAKeyPref = "loop.key.fxa"; | ||
|
||
do_register_cleanup(function() { | ||
Services.prefs.clearUserPref(kGuestKeyPref); | ||
|
@@ -33,12 +34,25 @@ add_task(function* test_guestGetKey() { | |
Assert.equal(key, kFakeKey, "should return existing key"); | ||
}); | ||
|
||
add_task(function* test_fxaGetKnownKey() { | ||
const kFakeKey = "75312468"; | ||
// Set the userProfile to look like we're logged into FxA with a key stored. | ||
MozLoopServiceInternal.fxAOAuthTokenData = { token_type: "bearer" }; | ||
MozLoopServiceInternal.fxAOAuthProfile = { email: "[email protected]" }; | ||
Services.prefs.setCharPref(kFxAKeyPref, kFakeKey); | ||
|
||
let key = yield MozLoopService.promiseProfileEncryptionKey(); | ||
|
||
Assert.equal(key, kFakeKey, "should return existing key"); | ||
}); | ||
|
||
add_task(function* test_fxaGetKey() { | ||
// Set the userProfile to look like we're logged into FxA. | ||
// Set the userProfile to look like we're logged into FxA without a key stored. | ||
MozLoopServiceInternal.fxAOAuthTokenData = { token_type: "bearer" }; | ||
MozLoopServiceInternal.fxAOAuthProfile = { email: "[email protected]" }; | ||
Services.prefs.clearUserPref(kFxAKeyPref); | ||
|
||
// Currently unimplemented, add a test when we implement the code. | ||
yield Assert.rejects(MozLoopService.promiseProfileEncryptionKey(), | ||
/unimplemented/, "should reject as unimplemented"); | ||
/not implemented/, "should reject as unimplemented"); | ||
}); |
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
Oops, something went wrong.