Commit 4bcd0855 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

Remove unifiedConsentEnabled from all settings resources.

This CL removes unifiedConsentEnabled variable from all settings
resources that were still referencing it.

Bug: 1015805

Change-Id: I8c12a9558a4cfab236d423c037f92e24bea99975
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1878195Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710259}
parent 0114fc7b
......@@ -185,7 +185,6 @@
page-title="$i18n{syncPageTitle}"
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
<settings-sync-page
unified-consent-enabled
sync-status="[[syncStatus]]" prefs="{{prefs}}"
page-visibility="[[pageVisibility.privacy]]">
</settings-sync-page>
......
......@@ -146,7 +146,6 @@
<template is="dom-if" if="[[shouldShowSyncAccountControl_(diceEnabled_,
syncStatus.syncSystemEnabled, syncStatus.signinAllowed)]]">
<settings-sync-account-control
unified-consent-enabled
sync-status="[[syncStatus]]"
promo-label-with-account="$i18n{peopleSignInPrompt}"
promo-label-with-no-account="$i18n{peopleSignInPrompt}"
......@@ -300,7 +299,6 @@
<if expr="not chromeos">
dice-enabled="[[diceEnabled_]]"
</if>
unified-consent-enabled
sync-status="[[syncStatus]]" prefs="{{prefs}}"
page-visibility="[[pageVisibility.privacy]]">
</settings-sync-page>
......
......@@ -181,8 +181,7 @@
[[getAccountLabel_(
'$i18nPolymer{syncingTo}', shownAccount_.email,
syncStatus.hasError, syncStatus.signedIn,
syncStatus.disabled, syncStatus.firstSetupInProgress,
unifiedConsentEnabled)]]
syncStatus.disabled, syncStatus.firstSetupInProgress)]]
</div>
</div>
</div>
......
......@@ -87,12 +87,10 @@ Polymer({
'promoSecondaryLabelWithNoAccount, shownAccount_)',
},
unifiedConsentEnabled: Boolean,
/** @private */
showSetupButtons_: {
type: Boolean,
computed: 'computeShowSetupButtons_(unifiedConsentEnabled,' +
computed: 'computeShowSetupButtons_(' +
'hideButtons, syncStatus.firstSetupInProgress)',
},
},
......@@ -210,7 +208,7 @@ Polymer({
* @private
*/
getAccountLabel_: function(label, account) {
if (this.unifiedConsentEnabled && this.syncStatus.firstSetupInProgress) {
if (this.syncStatus.firstSetupInProgress) {
return this.syncStatus.statusText || account;
}
return this.syncStatus.signedIn && !this.syncStatus.hasError &&
......@@ -455,8 +453,7 @@ Polymer({
* @private
*/
computeShowSetupButtons_: function() {
return !this.hideButtons && !!this.unifiedConsentEnabled &&
!!this.syncStatus.firstSetupInProgress;
return !this.hideButtons && !!this.syncStatus.firstSetupInProgress;
},
/** @private */
......
......@@ -14,7 +14,6 @@
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="sync_browser_proxy.html">
<link rel="import" href="sync_controls.html">
<link rel="import" href="../privacy_page/personalization_options.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
......@@ -96,10 +95,8 @@
</style>
<if expr="not chromeos">
<template is="dom-if" if="[[shouldShowSyncAccountControl_(
unifiedConsentEnabled, syncStatus.syncSystemEnabled,
syncStatus.signinAllowed)]]">
syncStatus.syncSystemEnabled, syncStatus.signinAllowed)]]">
<settings-sync-account-control embedded-in-subpage
unified-consent-enabled="[[unifiedConsentEnabled]]"
sync-status="[[syncStatus]]"
promo-label-with-account=
"$i18n{peopleSignInPromptSecondaryWithAccount}"
......@@ -117,7 +114,7 @@
</div>
<template is="dom-if" if="[[shouldShowExistingPassphraseBelowAccount_(
unifiedConsentEnabled, syncPrefs.passphraseRequired)]]"
syncPrefs.passphraseRequired)]]"
on-dom-change="focusPassphraseInput_">
<div id="existingPassphrase" class="list-frame">
<div id="existingPassphraseTitle" class="list-item">
......@@ -150,7 +147,7 @@
<div id="sync-separator" hidden="[[!syncSectionDisabled_]]"></div>
<div id="sync-section" hidden="[[syncSectionDisabled_]]">
<div class="settings-box first" hidden="[[!unifiedConsentEnabled]]">
<div class="settings-box first">
<h2 class="cr-title-text start">$i18n{sync}</h2>
</div>
......@@ -164,67 +161,17 @@
</div>
<div id="[[pages_.CONFIGURE]]"
hidden$="[[!isStatus_(pages_.CONFIGURE, pageStatus_)]]">
<!-- TODO(http://crbug.com/862983) Remove this section once the Unified
Consent feature is launched. -->
<template is="dom-if" if="[[shouldShowExistingPassphraseInSyncSection_(
unifiedConsentEnabled, syncPrefs.passphraseRequired)]]"
on-dom-change="focusPassphraseInput_">
<div id="existingPassphrase" class="list-frame">
<div class="list-item">
<div class="settings-box-text"
inner-h-t-m-l="[[syncPrefs.enterPassphraseBody]]">
</div>
</div>
<div id="existingPassphraseContainer" class="list-item">
<cr-input id="existingPassphraseInput" type="password"
value="{{existingPassphrase_}}"
placeholder="$i18n{passphrasePlaceholder}"
error-message="$i18n{incorrectPassphraseError}"
on-keypress="onSubmitExistingPassphraseTap_">
<cr-button id="submitExistingPassphrase" slot="suffix"
on-click="onSubmitExistingPassphraseTap_"
class="action-button" disabled="[[!existingPassphrase_]]">
$i18n{submitPassphraseButton}
</cr-button>
</cr-input>
</div>
<div id="passphraseRecoverHint" class="list-item">
<span>$i18nRaw{passphraseRecover}</span>
<div id="other-sync-items" class="list-frame">
<div id="sync-advanced-row" class="list-item first"
on-click="onSyncAdvancedTap_" actionable>
<div class="start">
$i18n{syncAdvancedPageTitle}
</div>
<cr-icon-button class="subpage-arrow"
aria-label="$i18n{syncAdvancedPageTitle}"></cr-icon-button>
</div>
</template>
<template is="dom-if" if="[[!unifiedConsentEnabled]]">
<settings-sync-controls sync-status="[[syncStatus]]">
</settings-sync-controls>
</template>
<div id="other-sync-items"
class$="[[getListFrameClass_(unifiedConsentEnabled)]]">
<template is="dom-if" if="[[unifiedConsentEnabled]]">
<div id="sync-advanced-row" class="list-item first"
on-click="onSyncAdvancedTap_" actionable>
<div class="start">
$i18n{syncAdvancedPageTitle}
</div>
<cr-icon-button class="subpage-arrow"
aria-label="$i18n{syncAdvancedPageTitle}"></cr-icon-button>
</div>
</template>
<template is="dom-if"
if="[[shouldShowDriveSuggest_(unifiedConsentEnabled)]]" restamp>
<settings-toggle-button
class$="[[getListItemClass_(unifiedConsentEnabled)]]"
pref="{{prefs.documentsuggest.enabled}}"
label="$i18n{driveSuggestPref}"
sub-label="$i18n{driveSuggestPrefDesc}">
</settings-toggle-button>
</template>
<a class$="inherit-color no-outline
[[getListItemClass_(unifiedConsentEnabled)]]" tabindex="-1"
<a class="inherit-color no-outline list-item" tabindex="-1"
target="_blank" href="$i18n{activityControlsUrl}"
on-click="onActivityControlsTap_">
<div class="start settings-box-text">
......@@ -234,8 +181,7 @@
</a>
<a id="syncDashboardLink"
class$="inherit-color no-outline
[[getListItemClass_(unifiedConsentEnabled)]]"
class="inherit-color no-outline list-item"
tabindex="-1" target="_blank" href="$i18n{syncDashboardUrl}"
hidden="[[syncStatus.supervisedUser]]">
<div class="start settings-box-text">
......@@ -248,7 +194,7 @@
hidden="[[syncPrefs.passphraseRequired]]"
class$="single-column settings-box-text
[[getPassphraseHintLines_(syncPrefs.encryptAllData)]]
[[getListItemClass_(unifiedConsentEnabled)]]">
list-item">
$i18n{encryptionOptionsTitle}
<div class="secondary">
$i18n{syncDataEncryptedText}
......@@ -317,17 +263,14 @@
</div>
</div>
<template is="dom-if" if="[[unifiedConsentEnabled]]">
<div class="settings-box first">
<h2 class="cr-title-text">
$i18n{nonPersonalizedServicesSectionLabel}
</h2>
</div>
<settings-personalization-options class="list-frame" prefs="{{prefs}}"
page-visibility="[[pageVisibility]]" sync-status="[[syncStatus]]"
unified-consent-enabled="[[unifiedConsentEnabled]]">
</settings-personalization-options>
</template>
<div class="settings-box first">
<h2 class="cr-title-text">
$i18n{nonPersonalizedServicesSectionLabel}
</h2>
</div>
<settings-personalization-options class="list-frame" prefs="{{prefs}}"
page-visibility="[[pageVisibility]]" sync-status="[[syncStatus]]">
</settings-personalization-options>
<if expr="not chromeos">
<template is="dom-if" if="[[showSetupCancelDialog_]]" restamp>
......@@ -347,15 +290,6 @@
</div>
</cr-dialog>
</template>
<template is="dom-if" if="[[!unifiedConsentEnabled]]">
<cr-toast id="toast" open="[[syncStatus.firstSetupInProgress]]">
<div>$i18n{syncWillStart}</div>
<cr-button on-click="onSyncSetupCancel_">
$i18n{cancelSync}
</cr-button>
</cr-toast>
</template>
</if>
</template>
<script src="sync_page.js"></script>
......
......@@ -129,7 +129,7 @@ Polymer({
type: Boolean,
value: false,
computed: 'computeSyncSectionDisabled_(' +
'unifiedConsentEnabled, syncStatus.signedIn, syncStatus.disabled, ' +
'syncStatus.signedIn, syncStatus.disabled, ' +
'syncStatus.hasError, syncStatus.statusAction)',
},
......@@ -137,11 +137,6 @@ Polymer({
diceEnabled: Boolean,
// </if>
unifiedConsentEnabled: {
type: Boolean,
observer: 'initializeDidAbort_',
},
/** @private */
showSetupCancelDialog_: {
type: Boolean,
......@@ -159,12 +154,9 @@ Polymer({
browserProxy_: null,
/**
* If unified consent is enabled, the beforeunload callback is used to
* show the 'Leave site' dialog. This makes sure that the user has the chance
* to go back and confirm the sync opt-in before leaving.
*
* If unified consent is disabled, the beforeunload callback is used
* to confirm the sync setup before leaving the opt-in flow.
* The beforeunload callback is used to show the 'Leave site' dialog. This
* makes sure that the user has the chance to go back and confirm the sync
* opt-in before leaving.
*
* This property is non-null if the user is currently navigated on the sync
* settings route.
......@@ -174,9 +166,8 @@ Polymer({
beforeunloadCallback_: null,
/**
* If unified consent is enabled, the unload callback is used to cancel the
* sync setup when the user hits the browser back button after arriving on the
* page.
* The unload callback is used to cancel the sync setup when the user hits
* the browser back button after arriving on the page.
* Note: Cases like closing the tab or reloading don't need to be handled,
* because they are already caught in |PeopleHandler::~PeopleHandler|
* from the C++ code.
......@@ -193,11 +184,10 @@ Polymer({
collapsibleSectionsInitialized_: false,
/**
* Whether the user decided to abort sync. When unified consent is enabled,
* this is initialized to true.
* Whether the user decided to abort sync.
* @private {boolean}
*/
didAbort_: false,
didAbort_: true,
/**
* Whether the user confirmed the cancellation of sync.
......@@ -251,7 +241,7 @@ Polymer({
* @private
*/
computeSyncSectionDisabled_: function() {
return !!this.unifiedConsentEnabled && this.syncStatus !== undefined &&
return this.syncStatus !== undefined &&
(!this.syncStatus.signedIn || !!this.syncStatus.disabled ||
(!!this.syncStatus.hasError &&
this.syncStatus.statusAction !==
......@@ -308,8 +298,7 @@ Polymer({
const userActionCancelsSetup = this.syncStatus &&
this.syncStatus.firstSetupInProgress && this.didAbort_;
if (this.unifiedConsentEnabled && userActionCancelsSetup &&
!this.setupCancelConfirmed_) {
if (userActionCancelsSetup && !this.setupCancelConfirmed_) {
chrome.metricsPrivate.recordUserAction(
'Signin_Signin_BackOnAdvancedSyncSettings');
// Show the 'Cancel sync?' dialog.
......@@ -357,27 +346,21 @@ Polymer({
this.browserProxy_.didNavigateToSyncPage();
if (this.unifiedConsentEnabled) {
this.beforeunloadCallback_ = event => {
// When the user tries to leave the sync setup, show the 'Leave site'
// dialog.
if (this.unifiedConsentEnabled && this.syncStatus &&
this.syncStatus.firstSetupInProgress) {
event.preventDefault();
event.returnValue = '';
chrome.metricsPrivate.recordUserAction(
'Signin_Signin_AbortAdvancedSyncSettings');
}
};
window.addEventListener('beforeunload', this.beforeunloadCallback_);
this.beforeunloadCallback_ = event => {
// When the user tries to leave the sync setup, show the 'Leave site'
// dialog.
if (this.syncStatus && this.syncStatus.firstSetupInProgress) {
event.preventDefault();
event.returnValue = '';
this.unloadCallback_ = this.onNavigateAwayFromPage_.bind(this);
window.addEventListener('unload', this.unloadCallback_);
} else {
this.beforeunloadCallback_ = this.onNavigateAwayFromPage_.bind(this);
window.addEventListener('beforeunload', this.beforeunloadCallback_);
}
chrome.metricsPrivate.recordUserAction(
'Signin_Signin_AbortAdvancedSyncSettings');
}
};
window.addEventListener('beforeunload', this.beforeunloadCallback_);
this.unloadCallback_ = this.onNavigateAwayFromPage_.bind(this);
window.addEventListener('unload', this.unloadCallback_);
},
/** @private */
......@@ -391,7 +374,6 @@ Polymer({
this.pageStatus_ = settings.PageStatus.CONFIGURE;
this.browserProxy_.didNavigateAwayFromSyncPage(this.didAbort_);
this.initializeDidAbort_();
window.removeEventListener('beforeunload', this.beforeunloadCallback_);
this.beforeunloadCallback_ = null;
......@@ -567,28 +549,6 @@ Polymer({
}
},
/**
* When unified-consent enabled, the non-toggle items on the bottom of sync
* section should be wrapped with 'list-frame' in order to be indented
* correctly.
* @return {string}
* @private
*/
getListFrameClass_: function() {
return this.unifiedConsentEnabled ? 'list-frame' : '';
},
/**
* When unified-consent enabled, the non-toggle items on the bottom of sync
* section will be wrapped with 'list-frame', and should have the 'list-item'
* instead of 'settings-box' in order to be indented correctly.
* @return {string}
* @private
*/
getListItemClass_: function() {
return this.unifiedConsentEnabled ? 'list-item' : 'settings-box';
},
/**
* When there is a sync passphrase, some items have an additional line for the
* passphrase reset hint, making them three lines rather than two.
......@@ -605,7 +565,7 @@ Polymer({
* @private
*/
shouldShowSyncAccountControl_: function() {
return !!this.unifiedConsentEnabled && this.syncStatus !== undefined &&
return this.syncStatus !== undefined &&
!!this.syncStatus.syncSystemEnabled && !!this.syncStatus.signinAllowed;
},
// </if>
......@@ -615,17 +575,7 @@ Polymer({
* @private
*/
shouldShowExistingPassphraseBelowAccount_: function() {
return !!this.unifiedConsentEnabled && this.syncPrefs !== undefined &&
!!this.syncPrefs.passphraseRequired;
},
/**
* @return {boolean}
* @private
*/
shouldShowExistingPassphraseInSyncSection_: function() {
return !this.unifiedConsentEnabled && this.syncPrefs !== undefined &&
!!this.syncPrefs.passphraseRequired;
return this.syncPrefs !== undefined && !!this.syncPrefs.passphraseRequired;
},
/**
......@@ -652,29 +602,6 @@ Polymer({
settings.navigateTo(settings.routes.SYNC_ADVANCED);
},
/**
* @return {boolean}
* @private
*/
shouldShowDriveSuggest_: function() {
return loadTimeData.getBoolean('driveSuggestAvailable') &&
!this.unifiedConsentEnabled;
},
/**
* Used when unified consent is disabled.
* @private
*/
onSyncSetupCancel_: function() {
this.didAbort_ = true;
settings.navigateTo(settings.routes.BASIC);
},
/** @private */
initializeDidAbort_: function() {
this.didAbort_ = !!this.unifiedConsentEnabled;
},
/**
* @param {!CustomEvent<boolean>} e The event passed from
* settings-sync-account-control.
......
......@@ -69,13 +69,11 @@
</settings-toggle-button>
</if><!-- not chromeos -->
</if><!-- _google_chrome -->
<template is="dom-if" if="[[unifiedConsentEnabled]]">
<settings-toggle-button
pref="{{prefs.url_keyed_anonymized_data_collection.enabled}}"
label="$i18n{urlKeyedAnonymizedDataCollection}"
sub-label="$i18n{urlKeyedAnonymizedDataCollectionDesc}">
</settings-toggle-button>
</template>
<settings-toggle-button
pref="{{prefs.url_keyed_anonymized_data_collection.enabled}}"
label="$i18n{urlKeyedAnonymizedDataCollection}"
sub-label="$i18n{urlKeyedAnonymizedDataCollectionDesc}">
</settings-toggle-button>
<if expr="_google_chrome">
<settings-toggle-button id="spellCheckControl"
pref="{{prefs.spellcheck.use_spelling_service}}"
......@@ -85,7 +83,7 @@
hidden="[[!showSpellCheckControl_(prefs.spellcheck.dictionaries)]]">
</settings-toggle-button>
</if><!-- _google_chrome -->
<template is="dom-if" if="[[shouldShowDriveSuggest_(unifiedConsentEnabled,
<template is="dom-if" if="[[shouldShowDriveSuggest_(
syncStatus, syncStatus.signedIn, syncStatus.statusAction)]]" restamp>
<settings-toggle-button id="driveSuggestControl"
pref="{{prefs.documentsuggest.enabled}}"
......
......@@ -29,8 +29,6 @@ Polymer({
*/
pageVisibility: Object,
unifiedConsentEnabled: Boolean,
/** @type {settings.SyncStatus} */
syncStatus: Object,
......@@ -127,10 +125,10 @@ Polymer({
* @private
*/
showSpellCheckControl_: function() {
return !this.unifiedConsentEnabled ||
(!!this.prefs.spellcheck &&
/** @type {!Array<string>} */
(this.prefs.spellcheck.dictionaries.value).length > 0);
return (
!!this.prefs.spellcheck &&
/** @type {!Array<string>} */
(this.prefs.spellcheck.dictionaries.value).length > 0);
},
/**
......@@ -139,8 +137,7 @@ Polymer({
*/
shouldShowDriveSuggest_: function() {
return loadTimeData.getBoolean('driveSuggestAvailable') &&
!!this.unifiedConsentEnabled && !!this.syncStatus &&
!!this.syncStatus.signedIn &&
!!this.syncStatus && !!this.syncStatus.signedIn &&
this.syncStatus.statusAction !== settings.StatusAction.REAUTHENTICATE;
},
});
......
......@@ -86,7 +86,6 @@ AccessibilityTest.define('SettingsA11ySignOut', {
if (this.peoplePage.diceEnabled_) {
const syncAccountControl =
this.peoplePage.$$('settings-sync-account-control');
syncAccountControl.unifiedConsentEnabled = true;
syncAccountControl.syncStatus = {
firstSetupInProgress: false,
signedIn: true,
......
......@@ -11,12 +11,10 @@ suite('sync-page-test', function() {
settings.navigateTo(settings.routes.SYNC);
syncPage = document.createElement('settings-sync-page');
document.body.appendChild(syncPage);
Polymer.dom.flush();
});
test('autofocus passphrase input', function() {
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush();
cr.webUIListenerCallback('sync-prefs-changed', {passphraseRequired: false});
Polymer.dom.flush();
// Passphrase input is not available when no passphrase is required.
......
......@@ -84,20 +84,7 @@ cr.define('settings_people_page_sync_page', function() {
.then(testRecreate);
});
test('SyncSectionLayout_NoUnifiedConsent_SignedIn', function() {
const syncSection = syncPage.$$('#sync-section');
const otherItems = syncPage.$$('#other-sync-items');
syncPage.syncStatus = {signedIn: true, disabled: false};
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
assertFalse(syncSection.hidden);
assertTrue(syncPage.$$('#sync-separator').hidden);
assertFalse(otherItems.classList.contains('list-frame'));
assertFalse(!!otherItems.querySelector('list-item'));
});
test('SyncSectionLayout_UnifiedConsentEnabled_SignedIn', function() {
test('SyncSectionLayout_SignedIn', function() {
const syncSection = syncPage.$$('#sync-section');
const otherItems = syncPage.$$('#other-sync-items');
......@@ -107,7 +94,6 @@ cr.define('settings_people_page_sync_page', function() {
hasError: false,
statusAction: settings.StatusAction.NO_ACTION,
};
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush();
assertFalse(syncSection.hidden);
assertTrue(syncPage.$$('#sync-separator').hidden);
......@@ -136,7 +122,7 @@ cr.define('settings_people_page_sync_page', function() {
assertTrue(syncPage.$$('#sync-separator').hidden);
});
test('SyncSectionLayout_UnifiedConsentEnabled_SignedOut', function() {
test('SyncSectionLayout_SignedOut', function() {
const syncSection = syncPage.$$('#sync-section');
syncPage.syncStatus = {
......@@ -145,13 +131,12 @@ cr.define('settings_people_page_sync_page', function() {
hasError: false,
statusAction: settings.StatusAction.NO_ACTION,
};
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush();
assertTrue(syncSection.hidden);
assertFalse(syncPage.$$('#sync-separator').hidden);
});
test('SyncSectionLayout_UnifiedConsentEnabled_SyncDisabled', function() {
test('SyncSectionLayout_SyncDisabled', function() {
const syncSection = syncPage.$$('#sync-section');
syncPage.syncStatus = {
......@@ -160,7 +145,6 @@ cr.define('settings_people_page_sync_page', function() {
hasError: false,
statusAction: settings.StatusAction.NO_ACTION,
};
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush();
assertTrue(syncSection.hidden);
});
......@@ -350,8 +334,6 @@ cr.define('settings_people_page_sync_page', function() {
prefs.encryptAllData = true;
prefs.passphraseRequired = true;
cr.webUIListenerCallback('sync-prefs-changed', prefs);
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
const existingPassphraseInput =
......@@ -371,8 +353,6 @@ cr.define('settings_people_page_sync_page', function() {
prefs.encryptAllData = true;
prefs.passphraseRequired = true;
cr.webUIListenerCallback('sync-prefs-changed', prefs);
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
const existingPassphraseInput = syncPage.$$('#existingPassphraseInput');
......@@ -403,8 +383,6 @@ cr.define('settings_people_page_sync_page', function() {
prefs.encryptAllData = true;
prefs.passphraseRequired = true;
cr.webUIListenerCallback('sync-prefs-changed', prefs);
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
const existingPassphraseInput = syncPage.$$('#existingPassphraseInput');
......@@ -438,7 +416,6 @@ cr.define('settings_people_page_sync_page', function() {
});
test('SyncAdvancedRow', function() {
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush();
const syncAdvancedRow = syncPage.$$('#sync-advanced-row');
......@@ -525,47 +502,8 @@ cr.define('settings_people_page_sync_page', function() {
// ##################################
if (!cr.isChromeOS) {
test('SyncSetupCancel_UnifiedConsentDisabled', function() {
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
const toast = syncPage.$$('cr-toast');
// During initialization, the toast values start as undefined/false.
syncPage.syncStatus = {};
Polymer.dom.flush();
assertTrue(!!toast);
assertFalse(!!toast.open);
// Next, the toast shows up during setup.
syncPage.syncStatus = {firstSetupInProgress: true};
Polymer.dom.flush();
assertTrue(toast.open);
// At the end, confirm that setup can be cancelled.
toast.querySelector('cr-button').click();
return browserProxy.whenCalled('didNavigateAwayFromSyncPage')
.then(abort => {
assertTrue(abort);
});
});
test('SyncSetupLeavePage UnifiedConsentDisabled', function() {
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
settings.navigateTo(settings.routes.BASIC);
return browserProxy.whenCalled('didNavigateAwayFromSyncPage')
.then(abort => {
assertFalse(abort);
});
});
test('SyncSetupCancel UnifiedConsentEnabled', function() {
test('SyncSetupCancel', function() {
syncPage.diceEnabled = true;
syncPage.unifiedConsentEnabled = true;
syncPage.syncStatus = {
signinAllowed: true,
syncSystemEnabled: true,
......@@ -588,9 +526,8 @@ cr.define('settings_people_page_sync_page', function() {
});
});
test('SyncSetupConfirm UnifiedConsentEnabled', function() {
test('SyncSetupConfirm', function() {
syncPage.diceEnabled = true;
syncPage.unifiedConsentEnabled = true;
syncPage.syncStatus = {
signinAllowed: true,
syncSystemEnabled: true,
......@@ -613,8 +550,7 @@ cr.define('settings_people_page_sync_page', function() {
});
});
test('SyncSetupLeavePage UnifiedConsentEnabled', function() {
syncPage.unifiedConsentEnabled = true;
test('SyncSetupLeavePage', function() {
syncPage.syncStatus = {
signinAllowed: true,
syncSystemEnabled: true,
......@@ -664,8 +600,7 @@ cr.define('settings_people_page_sync_page', function() {
});
});
test('SyncSetupSearchSettings UnifiedConsentEnabled', function() {
syncPage.unifiedConsentEnabled = true;
test('SyncSetupSearchSettings', function() {
syncPage.syncStatus = {
signinAllowed: true,
syncSystemEnabled: true,
......@@ -689,7 +624,6 @@ cr.define('settings_people_page_sync_page', function() {
syncPage.diceEnabled = true;
Polymer.dom.flush();
assertFalse(!!syncPage.$$('settings-sync-account-control'));
syncPage.unifiedConsentEnabled = true;
syncPage.syncStatus = {signinAllowed: false, syncSystemEnabled: false};
Polymer.dom.flush();
assertFalse(!!syncPage.$$('settings-sync-account-control'));
......
......@@ -32,7 +32,6 @@ cr.define('settings_personalization_options', function() {
test('DriveSearchSuggestControl', function() {
assertFalse(!!testElement.$$('#driveSuggestControl'));
testElement.unifiedConsentEnabled = true;
testElement.syncStatus = {
signedIn: true,
statusAction: settings.StatusAction.NO_ACTION
......@@ -68,8 +67,7 @@ cr.define('settings_personalization_options', function() {
testElement.remove();
});
test('UnifiedConsent spellcheck toggle', function() {
testElement.unifiedConsentEnabled = true;
test('Spellcheck toggle', function() {
testElement.prefs = {spellcheck: {dictionaries: {value: ['en-US']}}};
Polymer.dom.flush();
assertFalse(testElement.$.spellCheckControl.hidden);
......@@ -89,24 +87,5 @@ cr.define('settings_personalization_options', function() {
testElement.$.spellCheckControl.click();
assertTrue(testElement.prefs.spellcheck.use_spelling_service.value);
});
test('NoUnifiedConsent spellcheck toggle', function() {
testElement.unifiedConsentEnabled = false;
testElement.prefs = {spellcheck: {dictionaries: {value: ['en-US']}}};
Polymer.dom.flush();
assertFalse(testElement.$.spellCheckControl.hidden);
testElement.prefs = {spellcheck: {dictionaries: {value: []}}};
Polymer.dom.flush();
assertFalse(testElement.$.spellCheckControl.hidden);
testElement.prefs = {
browser: {enable_spellchecking: {value: false}},
spellcheck: {use_spelling_service: {value: false}}
};
Polymer.dom.flush();
testElement.$.spellCheckControl.click();
assertTrue(testElement.prefs.spellcheck.use_spelling_service.value);
});
});
});
......@@ -130,7 +130,6 @@ cr.define('settings_sync_account_control', function() {
});
test('not signed in but has stored accounts', function() {
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = {
firstSetupInProgress: false,
signedIn: false,
......@@ -224,7 +223,6 @@ cr.define('settings_sync_account_control', function() {
});
test('signed in, no error', function() {
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = {
firstSetupInProgress: false,
signedIn: true,
......@@ -260,7 +258,6 @@ cr.define('settings_sync_account_control', function() {
});
test('signed in, has error', function() {
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = {
firstSetupInProgress: false,
signedIn: true,
......@@ -341,7 +338,6 @@ cr.define('settings_sync_account_control', function() {
});
test('signed in, setup in progress', function() {
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = {
signedIn: true,
signedInUsername: 'bar@bar.com',
......@@ -356,12 +352,6 @@ cr.define('settings_sync_account_control', function() {
const userInfo = testElement.$$('#user-info');
const setupButtons = testElement.$$('#setup-buttons');
assertTrue(userInfo.textContent.includes('barName'));
assertFalse(userInfo.textContent.includes('Setup in progress...'));
assertVisible(setupButtons, false);
testElement.unifiedConsentEnabled = true;
assertTrue(userInfo.textContent.includes('barName'));
assertTrue(userInfo.textContent.includes('Setup in progress...'));
assertVisible(setupButtons, true);
......@@ -373,7 +363,6 @@ cr.define('settings_sync_account_control', function() {
const banner = testElement.$$('#banner');
assertVisible(banner, true);
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = {
firstSetupInProgress: false,
signedIn: true,
......@@ -443,7 +432,6 @@ cr.define('settings_sync_account_control', function() {
test('hide buttons', function() {
testElement.hideButtons = true;
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = {
firstSetupInProgress: false,
signedIn: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment