Merge branch 'train-92'
This commit is contained in:
Коммит
08d29b4b8c
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,3 +1,15 @@
|
|||
<a name="1.92.2"></a>
|
||||
## 1.92.2 (2017-07-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **sms:** Ensure SMS can be sent on Fx 55+. (#5301) r=@philbooth ([22f3838](https://github.com/mozilla/fxa-content-server/commit/22f3838))
|
||||
* **sync:** Only show `addresses` if the browser says it's supported. (#5296) r=@philbooth ( ([e3d9cc0](https://github.com/mozilla/fxa-content-server/commit/e3d9cc0)), closes [#5292](https://github.com/mozilla/fxa-content-server/issues/5292)
|
||||
* **test:** Fix the OAuth with handshake tests on latest/stage/prod. ([c658662](https://github.com/mozilla/fxa-content-server/commit/c658662)), closes [#5300](https://github.com/mozilla/fxa-content-server/issues/5300)
|
||||
|
||||
|
||||
|
||||
<a name="1.92.1"></a>
|
||||
## 1.92.1 (2017-07-25)
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ define(function (require, exports, module) {
|
|||
|
||||
const browserAccountData = this._authenticationBroker.get('browserSignedInAccount');
|
||||
if (user.shouldSetSignedInAccountFromBrowser(this._relier.get('service'))) {
|
||||
user.setSignedInAccountFromBrowserAccountData(browserAccountData);
|
||||
return user.setSignedInAccountFromBrowserAccountData(browserAccountData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -490,7 +490,9 @@ define(function (require, exports, module) {
|
|||
|
||||
it('creates a user, sets the uniqueUserId, populates from the browser', () => {
|
||||
return appStart.initializeUser()
|
||||
.then(() => {
|
||||
.then((result) => {
|
||||
assert.isTrue(result);
|
||||
|
||||
assert.isDefined(appStart._user);
|
||||
assert.isDefined(appStart._user.get('uniqueUserId'));
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "fxa-content-server",
|
||||
"version": "1.92.1",
|
||||
"version": "1.92.2",
|
||||
"description": "Firefox Accounts Content Server",
|
||||
"scripts": {
|
||||
"build-production": "grunt build",
|
||||
|
|
|
@ -859,6 +859,56 @@ define([
|
|||
.then(testElementExists('.attached' + attachedId));
|
||||
});
|
||||
|
||||
/**
|
||||
* Store the data sent for a WebChannel event into sessionStorage.
|
||||
*
|
||||
* @param {string} expectedCommand command to store data for.
|
||||
* @returns {promise}
|
||||
*/
|
||||
const storeWebChannelMessageData = thenify(function (expectedCommand) {
|
||||
return this.parent
|
||||
.executeAsync(function (expectedCommand, callback) {
|
||||
function listener(e) {
|
||||
var command = e.detail.message.command;
|
||||
if (command === expectedCommand) {
|
||||
const storedEvents = JSON.parse(sessionStorage.getItem('webChannelEventData')) || {};
|
||||
storedEvents[command] = e.detail.message;
|
||||
sessionStorage.setItem('webChannelEventData', JSON.stringify(storedEvents));
|
||||
removeEventListener('WebChannelMessageToChrome', listener);
|
||||
}
|
||||
}
|
||||
|
||||
function startListening() {
|
||||
try {
|
||||
addEventListener('WebChannelMessageToChrome', listener);
|
||||
callback();
|
||||
} catch (e) {
|
||||
// problem adding the listener, window may not be
|
||||
// ready, try again.
|
||||
removeEventListener('WebChannelMessageToChrome', listener);
|
||||
setTimeout(startListening, 0);
|
||||
}
|
||||
}
|
||||
|
||||
startListening();
|
||||
}, [ expectedCommand ]);
|
||||
});
|
||||
|
||||
/**
|
||||
* Get the data stored for a WebChannel message. Data is only stored
|
||||
* if the message is listened for using `storeWebChannelMessageData`
|
||||
*
|
||||
* @param {string} command
|
||||
* @returns {object}
|
||||
*/
|
||||
const getWebChannelMessageData = thenify(function (command) {
|
||||
return this.parent
|
||||
.execute(function (command) {
|
||||
const storedEvents = JSON.parse(sessionStorage.getItem('webChannelEventData')) || {};
|
||||
return storedEvents[command];
|
||||
}, [command]);
|
||||
});
|
||||
|
||||
function openWindow (url, name) {
|
||||
var newWindow = window.open(url, name || 'newwindow');
|
||||
|
||||
|
@ -1343,6 +1393,7 @@ define([
|
|||
return this.parent
|
||||
.execute(function (command, done) {
|
||||
sessionStorage.removeItem('webChannelEvents');
|
||||
sessionStorage.removeItem('webChannelEventData');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -1919,6 +1970,7 @@ define([
|
|||
getStoredAccountByEmail: getStoredAccountByEmail,
|
||||
getUnblockInfo: getUnblockInfo,
|
||||
getVerificationLink: getVerificationLink,
|
||||
getWebChannelMessageData,
|
||||
imageLoadedByQSA: imageLoadedByQSA,
|
||||
mousedown: mousedown,
|
||||
mouseevent: mouseevent,
|
||||
|
@ -1947,6 +1999,7 @@ define([
|
|||
pollUntilGoneByQSA: pollUntilGoneByQSA,
|
||||
reOpenWithAdditionalQueryParams: reOpenWithAdditionalQueryParams,
|
||||
respondToWebChannelMessage: respondToWebChannelMessage,
|
||||
storeWebChannelMessageData,
|
||||
switchToWindow: switchToWindow,
|
||||
takeScreenshot: takeScreenshot,
|
||||
testAreEventsLogged: testAreEventsLogged,
|
||||
|
|
|
@ -25,6 +25,9 @@ define([
|
|||
const click = FunctionalHelpers.click;
|
||||
const closeCurrentWindow = FunctionalHelpers.closeCurrentWindow;
|
||||
const fillOutSignUp = FunctionalHelpers.fillOutSignUp;
|
||||
const getVerificationLink = FunctionalHelpers.getVerificationLink;
|
||||
const getWebChannelMessageData = FunctionalHelpers.getWebChannelMessageData;
|
||||
const storeWebChannelMessageData = FunctionalHelpers.storeWebChannelMessageData;
|
||||
const noPageTransition = FunctionalHelpers.noPageTransition;
|
||||
const noSuchElement = FunctionalHelpers.noSuchElement;
|
||||
const noSuchBrowserNotification = FunctionalHelpers.noSuchBrowserNotification;
|
||||
|
@ -94,6 +97,70 @@ define([
|
|||
.then(testEmailExpected(email, 1));
|
||||
},
|
||||
|
||||
'Fx >= 55, verify same browser, force SMS': function () {
|
||||
let accountInfo;
|
||||
return this.remote
|
||||
.then(openPage(SIGNUP_FX_55_PAGE_URL, selectors.SIGNUP.HEADER, {
|
||||
webChannelResponses: {
|
||||
'fxaccounts:can_link_account': {
|
||||
ok: true
|
||||
},
|
||||
'fxaccounts:fxa_status': {
|
||||
signedInUser: null
|
||||
}
|
||||
}
|
||||
}))
|
||||
.then(storeWebChannelMessageData('fxaccounts:login'))
|
||||
.then(noSuchElement(selectors.SIGNUP.LINK_SUGGEST_SYNC))
|
||||
.then(fillOutSignUp(email, PASSWORD))
|
||||
|
||||
// user should be transitioned to /choose_what_to_sync
|
||||
.then(testElementExists(selectors.CHOOSE_WHAT_TO_SYNC.HEADER))
|
||||
|
||||
.then(testIsBrowserNotified('fxaccounts:can_link_account'))
|
||||
.then(noSuchBrowserNotification('fxaccounts:login'))
|
||||
|
||||
.then(click(selectors.CHOOSE_WHAT_TO_SYNC.SUBMIT))
|
||||
|
||||
// user should be transitioned to the "go confirm your address" page
|
||||
.then(testElementExists(selectors.CONFIRM_SIGNUP.HEADER))
|
||||
|
||||
// the login message is only sent after the sync preferences screen
|
||||
// has been cleared.
|
||||
.then(testIsBrowserNotified('fxaccounts:login'))
|
||||
// verify the user
|
||||
.then(getWebChannelMessageData('fxaccounts:login'))
|
||||
.then(function (message) {
|
||||
accountInfo = message.data;
|
||||
})
|
||||
.then(getVerificationLink(email, 0))
|
||||
.then(function (verificationLink) {
|
||||
return this.parent
|
||||
.then(openPage(verificationLink, selectors.SMS_SEND.HEADER, {
|
||||
query: {
|
||||
automatedBrowser: true,
|
||||
country: 'US',
|
||||
forceExperiment: 'sendSms',
|
||||
forceExperimentGroup: 'treatment',
|
||||
forceUA: uaStrings.desktop_firefox_55
|
||||
},
|
||||
webChannelResponses: {
|
||||
'fxaccounts:can_link_account': {
|
||||
ok: true
|
||||
},
|
||||
'fxaccounts:fxa_status': {
|
||||
signedInUser: {
|
||||
email: accountInfo.email,
|
||||
sessionToken: accountInfo.sessionToken,
|
||||
uid: accountInfo.uid,
|
||||
verified: accountInfo.verified
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
},
|
||||
|
||||
'Fx >= 56, engines not supported': function () {
|
||||
return this.remote
|
||||
.then(openPage(SIGNUP_FX_56_PAGE_URL, selectors.SIGNUP.HEADER, {
|
||||
|
|
Загрузка…
Ссылка в новой задаче