0

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:
Wes Okuhara
2024-04-24 17:05:46 +00:00
committed by Chromium LUCI CQ
parent e49c60394e
commit 01b17f592e
2 changed files with 1 additions and 9 deletions
chrome
browser
resources
ash
test
data
webui
chromeos

@ -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', () => {