Commit c4dc7f65 authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

Always show spellcheck toggle if unified consent disabled

If the unified consent feature is disabled, always
show the "Enhanced spell check" toggle.

Bug: 905470
Change-Id: I0fde90d956945a4089db4cfad95475635b94dc58
Reviewed-on: https://chromium-review.googlesource.com/c/1344050Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609836}
parent 9d34c48b
......@@ -130,9 +130,10 @@ Polymer({
* @private
*/
showSpellCheckControl_: function() {
return !!this.prefs.spellcheck &&
/** @type {!Array<string>} */
(this.prefs.spellcheck.dictionaries.value).length > 0;
return !this.unifiedConsentEnabled ||
(!!this.prefs.spellcheck &&
/** @type {!Array<string>} */
(this.prefs.spellcheck.dictionaries.value).length > 0);
},
});
})();
......@@ -35,7 +35,7 @@ cr.define('settings_personalization_options', function() {
testElement.root.querySelectorAll('settings-toggle-button').length);
});
test('hide spellcheck toggle when there is no dictionary', function() {
test('UnifiedConsent spellcheck toggle', function() {
testElement.unifiedConsentEnabled = true;
testElement.prefs = {spellcheck: {dictionaries: {value: ['en-US']}}};
Polymer.dom.flush();
......@@ -45,5 +45,16 @@ cr.define('settings_personalization_options', function() {
Polymer.dom.flush();
assertTrue(testElement.$.spellCheckControl.hidden);
});
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);
});
});
});
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