CrOS Settings: Set isPrefEnforced property as readonly
This property in PrefControlMixinInternal should be marked as readonly so TS can catch assignment errors. Bug: b:333454004 Test: browser_tests --gtest_filter="*OSSettings*PrefControlMixin*" Change-Id: I470e1f545e70699712ab45526de2a3afb694d2f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5479830 Commit-Queue: Wes Okuhara <wesokuhara@google.com> Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org> Cr-Commit-Position: refs/heads/main@{#1291948}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
e49c60394e
commit
01b17f592e
chrome
browser
resources
ash
settings
controls
test
data
webui
chromeos
settings
controls
@ -23,7 +23,7 @@ type PrefObject = chrome.settingsPrivate.PrefObject;
|
||||
|
||||
export interface PrefControlMixinInternalInterface {
|
||||
disabled: boolean;
|
||||
isPrefEnforced: boolean;
|
||||
readonly isPrefEnforced: boolean;
|
||||
pref?: PrefObject;
|
||||
validPrefTypes: chrome.settingsPrivate.PrefType[];
|
||||
dispatchPrefChange(value: any): void;
|
||||
|
@ -63,14 +63,6 @@ suite('PrefControlMixinInternal', () => {
|
||||
assertEquals(isPrefEnforced, testElement.isPrefEnforced);
|
||||
});
|
||||
});
|
||||
|
||||
test('is readonly', () => {
|
||||
// Attempt to set property.
|
||||
testElement.isPrefEnforced = true;
|
||||
|
||||
// Property does not change.
|
||||
assertFalse(testElement.isPrefEnforced);
|
||||
});
|
||||
});
|
||||
|
||||
suite('disabled property', () => {
|
||||
|
Reference in New Issue
Block a user