Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #33455 from begeeben/uplift/1222016_2.5
Browse files Browse the repository at this point in the history
Bug 1222016 - [TV Browser] There should be a pop-up window if user di…. r=ferjmoreno, a=jocheng
  • Loading branch information
BavarianTomcat committed Dec 1, 2015
2 parents 391bcad + 9c8ce88 commit 84a4dee
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tv_apps/browser/js/sync/settings.js
Expand Up @@ -162,6 +162,14 @@
}
switch (message.state) {
case 'disabled':
// We want to show a dialog once Sync is disabled
// but we only want to do that if it's disabled via user action
// (and not because it is already disabled from a previous run).
if (this.state === 'disabling') {
navigator.mozL10n.formatValue('fxsync-disabled').then(result => {
window.alert(result);
});
}
this.showScreen(DISABLED);
this.hideEnabling();
break;
Expand Down
4 changes: 4 additions & 0 deletions tv_apps/browser/locales/browser.en-US.properties
Expand Up @@ -103,6 +103,10 @@ fxsync-sign-in-to-sync-description=Sync your bookmarks and history from your Fir
fxsync-sign-in-to-sync-description-plus=You can create a Firefox Account on your smartphone or computer at https://accounts.firefox.com
fxsync-desktop-bookmarks=Desktop bookmarks
fxsync-mobile-bookmarks=Mobile bookmarks
fxsync-enabled=Success! Your Firefox Account is ready to go! In the future, you can access and manage your account from Settings.
fxsync-disabled=You have signed out successfully.
fxsync-error-offline=Unable to Connect
fxsync-error-offline-explanation=Please connect to a network from Settings.

# XXX: from partner
LT_APPS_SETTINGS=Settings
Expand Down
29 changes: 29 additions & 0 deletions tv_apps/browser/test/unit/sync/settings_test.js
Expand Up @@ -172,6 +172,35 @@ suite('Sync settings >', function() {
});
});

suite('Disabled from disabling', function() {
var alertStub;
var formatValueStub;
suiteSetup(function() {
formatValueStub = sinon.stub(navigator.mozL10n, 'formatValue', key => {
return Promise.resolve(key);
});

alertStub = sinon.stub(window, 'alert');

subject.state = 'disabling';
onsyncchange({
state: 'disabled',
user: 'pepito'
});
});

suiteTeardown(function() {
showScreenSpy.reset();
formatValueStub.restore();
alertStub.restore();
});

test('should show disabled dialog', function() {
expect(alertStub.calledOnce).to.equal(true);
expect(alertStub.args[0][0]).to.equal('fxsync-disabled');
});
});

suite('Enabled', function() {
suiteSetup(function() {
onsyncchange({
Expand Down

0 comments on commit 84a4dee

Please sign in to comment.