| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 # This data is in a separate file so that src/chrome/app/policy/PRESUBMIT.py | |
| 7 # can load it too without having to load pyautolib. | |
| 8 | |
| 9 # DO NOT import pyauto from here! This file is required to run a presubmit | |
| 10 # scripts that will always fail if pyautolib isn't available, which is common. | |
| 11 | |
| 12 | |
| 13 class PolicyPrefsTestCases(object): | |
| 14 """A list of test cases for policy_prefs_ui.py.""" | |
| 15 | |
| 16 [BROWSER, SEARCH_ENGINES, PASSWORDS, AUTOFILL, CONTENT, HOMEPAGE, LANGUAGES, | |
| 17 ACCOUNTS] = range(8) | |
| 18 | |
| 19 # Each policy has an entry with a tuple (Pref, Value, Pages, OS) | |
| 20 # | |
| 21 # |Pref| is the preference key for simple user policies that map directly to a | |
| 22 # preference (Refer to | |
| 23 # chrome/browser/policy/configuration_policy_handler_list.cc). | |
| 24 # Otherwise, set as None. | |
| 25 # | |
| 26 # |Value| is the value the policy should have when it is enforced. | |
| 27 # | |
| 28 # |Pages| is a list with integer indices into |settings_pages|, and lists all | |
| 29 # the pages that should display the managed-banner. | |
| 30 # Leave empty if this policy doesn't display anything visible in | |
| 31 # the settings. | |
| 32 # | |
| 33 # |OS| is a list of platforms where this policy should be tested. Valid | |
| 34 # platforms are 'win', 'mac', 'linux', and 'chromeos'. The list can be | |
| 35 # empty to skip the policy or set to OS_ALL if applicable to all | |
| 36 # platforms. | |
| 37 # | |
| 38 # ChromeOS device policies are also listed but are currently not tested by | |
| 39 # policy_prefs_ui.py. | |
| 40 [INDEX_PREF, INDEX_VALUE, INDEX_PAGES, INDEX_OS] = range(4) | |
| 41 OS_ALL = ['win', 'mac', 'linux', 'chromeos'] | |
| 42 policies = { | |
| 43 'HomepageLocation': | |
| 44 ('kHomePage', 'http://chromium.org', [HOMEPAGE], OS_ALL), | |
| 45 'HomepageIsNewTabPage': | |
| 46 ('kHomePageIsNewTabPage', True, [HOMEPAGE], OS_ALL), | |
| 47 # TODO(joaodasilva): Couldn't verify on linux. | |
| 48 'DefaultBrowserSettingEnabled': | |
| 49 ('kDefaultBrowserSettingEnabled', False, [], ['win', 'mac', 'linux']), | |
| 50 # TODO(joaodasilva): Test this on windows. | |
| 51 'ApplicationLocaleValue': ('kApplicationLocale', '', [], ['win']), | |
| 52 'AlternateErrorPagesEnabled': | |
| 53 ('kAlternateErrorPagesEnabled', False, [BROWSER], OS_ALL), | |
| 54 'SearchSuggestEnabled': | |
| 55 ('kSearchSuggestEnabled', False, [BROWSER], OS_ALL), | |
| 56 'DnsPrefetchingEnabled': | |
| 57 ('kNetworkPredictionEnabled', False, [BROWSER], OS_ALL), | |
| 58 'DisableSpdy': ('kDisableSpdy', True, [], OS_ALL), | |
| 59 'DisabledSchemes': ('kDisabledSchemes', ['file'], [], OS_ALL), | |
| 60 'JavascriptEnabled': (None, False, [CONTENT], OS_ALL), | |
| 61 'IncognitoEnabled': (None, False, [], OS_ALL), | |
| 62 'IncognitoModeAvailability': (None, 1, [], OS_ALL), | |
| 63 'SavingBrowserHistoryDisabled': | |
| 64 ('kSavingBrowserHistoryDisabled', True, [], OS_ALL), | |
| 65 'RemoteAccessClientFirewallTraversal': (None, True, [], OS_ALL), | |
| 66 # TODO(frankf): Enable on all OS after crbug.com/121066 is fixed. | |
| 67 'RemoteAccessHostFirewallTraversal': | |
| 68 ('kRemoteAccessHostFirewallTraversal', True, [], []), | |
| 69 'RemoteAccessHostRequireTwoFactor': | |
| 70 ('kRemoteAccessHostRequireTwoFactor', False, [], []), | |
| 71 'RemoteAccessHostDomain': ('kRemoteAccessHostDomain', '', [], []), | |
| 72 'RemoteAccessHostTalkGadgetPrefix': | |
| 73 ('kRemoteAccessHostTalkGadgetPrefix', 'chromoting-host', [], []), | |
| 74 'RemoteAccessHostRequireCurtain': | |
| 75 ('kRemoteAccessHostRequireCurtain', False, [], []), | |
| 76 'PrintingEnabled': ('kPrintingEnabled', False, [], OS_ALL), | |
| 77 # Note: supported_on is empty for this policy. | |
| 78 'CloudPrintProxyEnabled': ('kCloudPrintProxyEnabled', True, [], []), | |
| 79 'CloudPrintSubmitEnabled': | |
| 80 ('kCloudPrintSubmitEnabled', False, [], ['win', 'mac', 'linux']), | |
| 81 'SafeBrowsingEnabled': ('kSafeBrowsingEnabled', False, [BROWSER], OS_ALL), | |
| 82 # TODO(joaodasilva): This is only in place on official builds, but the | |
| 83 # SetUserCloudPolicy call is a nop on official builds. Should be BROWSER. | |
| 84 'MetricsReportingEnabled': | |
| 85 ('kMetricsReportingEnabled', False, [], ['win', 'mac', 'linux']), | |
| 86 'PasswordManagerEnabled': | |
| 87 ('kPasswordManagerEnabled', False, [BROWSER], OS_ALL), | |
| 88 # TODO(joaodasilva): Should be PASSWORDS too. http://crbug.com/97749 | |
| 89 'PasswordManagerAllowShowPasswords': | |
| 90 ('kPasswordManagerAllowShowPasswords', False, [BROWSER], OS_ALL), | |
| 91 'AutoFillEnabled': ('kAutofillEnabled', False, [BROWSER], OS_ALL), | |
| 92 'DisabledPlugins': ('kPluginsDisabledPlugins', ['Flash'], [], OS_ALL), | |
| 93 'EnabledPlugins': ('kPluginsEnabledPlugins', ['Flash'], [], OS_ALL), | |
| 94 'DisabledPluginsExceptions': | |
| 95 ('kPluginsDisabledPluginsExceptions', ['Flash'], [], OS_ALL), | |
| 96 'DisablePluginFinder': ('kDisablePluginFinder', True, [], OS_ALL), | |
| 97 # TODO(joaodasilva): Should be PERSONAL. http://crbug.com/97749 | |
| 98 'SyncDisabled': (None, True, [], OS_ALL), | |
| 99 'UserDataDir': | |
| 100 (None, '${users}/${user_name}/chrome-test', [], ['win', 'mac']), | |
| 101 'DiskCacheDir': | |
| 102 ('kDiskCacheDir', '${user_home}/test-cache', [], | |
| 103 ['win', 'mac', 'linux']), | |
| 104 'DiskCacheSize': ('kDiskCacheSize', 100, [], ['win', 'mac', 'linux']), | |
| 105 'MediaCacheSize': ('kMediaCacheSize', 200, [], ['win', 'mac', 'linux']), | |
| 106 'DownloadDirectory': (None, '${user_home}/test-downloads', [BROWSER], | |
| 107 ['win', 'mac', 'linux']), | |
| 108 'ClearSiteDataOnExit': (None, True, [CONTENT], OS_ALL), | |
| 109 # TODO(joaodasilva): Should be BROWSER. http://crbug.com/97749 | |
| 110 'ProxyMode': (None, 'direct', [], ['win', 'mac', 'linux']), | |
| 111 # TODO(joaodasilva): Should be BROWSER. http://crbug.com/97749 | |
| 112 'ProxyServerMode': (None, 0, [], ['win', 'mac', 'linux']), | |
| 113 'ProxyServer': | |
| 114 (None, 'http://localhost:8080', [], ['win', 'mac', 'linux']), | |
| 115 'ProxyPacUrl': | |
| 116 (None, 'http://localhost:8080/proxy.pac', [], | |
| 117 ['win', 'mac', 'linux']), | |
| 118 'ProxyBypassList': (None, 'localhost', [], ['win', 'mac', 'linux']), | |
| 119 # Note: this policy is only used internally for now. | |
| 120 'ProxySettings': (None, {}, [], []), | |
| 121 'EnableOriginBoundCerts': | |
| 122 ('kEnableOriginBoundCerts', False, [], ['win', 'mac', 'linux']), | |
| 123 'DisableSSLRecordSplitting': | |
| 124 ('kDisableSSLRecordSplitting', False, [], OS_ALL), | |
| 125 'EnableOnlineRevocationChecks': | |
| 126 ('kCertRevocationCheckingEnabled', False, [], OS_ALL), | |
| 127 'AuthSchemes': ('kAuthSchemes', 'AuthSchemes', [], OS_ALL), | |
| 128 'DisableAuthNegotiateCnameLookup': | |
| 129 ('kDisableAuthNegotiateCnameLookup', True, [], OS_ALL), | |
| 130 'EnableAuthNegotiatePort': | |
| 131 ('kEnableAuthNegotiatePort', False, [], OS_ALL), | |
| 132 'AuthServerWhitelist': ('kAuthServerWhitelist', 'localhost', [], OS_ALL), | |
| 133 'AuthNegotiateDelegateWhitelist': | |
| 134 ('kAuthNegotiateDelegateWhitelist', 'localhost', [], OS_ALL), | |
| 135 'GSSAPILibraryName': | |
| 136 ('kGSSAPILibraryName', 'libwhatever.so', [], ['mac', 'linux']), | |
| 137 'AllowCrossOriginAuthPrompt': | |
| 138 ('kAllowCrossOriginAuthPrompt', False, [], ['win', 'mac', 'linux']), | |
| 139 'ExtensionInstallBlacklist': | |
| 140 ('kExtensionInstallDenyList', ['*'], [], OS_ALL), | |
| 141 'ExtensionInstallWhitelist': | |
| 142 ('kExtensionInstallAllowList', ['lcncmkcnkcdbbanbjakcencbaoegdjlp'], | |
| 143 [], OS_ALL), | |
| 144 'ExtensionInstallForcelist': | |
| 145 ('kExtensionInstallForceList', ['lcncmkcnkcdbbanbjakcencbaoegdjlp;' + | |
| 146 'https://clients2.google.com/service/update2/crx'], [], OS_ALL), | |
| 147 'ExtensionInstallSources': | |
| 148 ('kExtensionAllowedInstallSites', ['https://www.corp.monkey.net/*'], | |
| 149 [], OS_ALL), | |
| 150 'ShowHomeButton': ('kShowHomeButton', True, [BROWSER], OS_ALL), | |
| 151 'DeveloperToolsDisabled': ('kDevToolsDisabled', True, [], OS_ALL), | |
| 152 'RestoreOnStartup': (None, 5, [BROWSER], OS_ALL), | |
| 153 # TODO(joaodasilva): Should be BROWSER. http://crbug.com/97749 | |
| 154 'RestoreOnStartupURLs': | |
| 155 ('kURLsToRestoreOnStartup', ['chromium.org'], [], OS_ALL), | |
| 156 # TODO(joaodasilva): The banner is out of place. http://crbug.com/77791 | |
| 157 'BlockThirdPartyCookies': | |
| 158 ('kBlockThirdPartyCookies', True, [CONTENT], OS_ALL), | |
| 159 # TODO(joaodasilva): Should be BROWSER. http://crbug.com/97749 | |
| 160 'DefaultSearchProviderEnabled': (None, False, [], OS_ALL), | |
| 161 'DefaultSearchProviderName': (None, 'google.com', [], OS_ALL), | |
| 162 'DefaultSearchProviderKeyword': (None, 'google', [], OS_ALL), | |
| 163 # TODO(joaodasilva): Should be BROWSER. http://crbug.com/97749 | |
| 164 'DefaultSearchProviderSearchURL': | |
| 165 (None, 'http://www.google.com/?q={searchTerms}', [], OS_ALL), | |
| 166 'DefaultSearchProviderSuggestURL': | |
| 167 (None, 'http://www.google.com/suggest?q={searchTerms}', [], OS_ALL), | |
| 168 'DefaultSearchProviderInstantURL': | |
| 169 (None, 'http://www.google.com/instant?q={searchTerms}', [], OS_ALL), | |
| 170 'DefaultSearchProviderIconURL': | |
| 171 (None, 'http://www.google.com/favicon.ico', [], OS_ALL), | |
| 172 'DefaultSearchProviderEncodings': (None, ['UTF-8'], [], OS_ALL), | |
| 173 'DefaultCookiesSetting': | |
| 174 ('kManagedDefaultCookiesSetting', 2, [CONTENT], OS_ALL), | |
| 175 'DefaultImagesSetting': | |
| 176 ('kManagedDefaultImagesSetting', 2, [CONTENT], OS_ALL), | |
| 177 'DefaultJavaScriptSetting': (None, 2, [CONTENT], OS_ALL), | |
| 178 'DefaultPluginsSetting': | |
| 179 ('kManagedDefaultPluginsSetting', 2, [CONTENT], OS_ALL), | |
| 180 'DefaultPopupsSetting': | |
| 181 ('kManagedDefaultPopupsSetting', 2, [CONTENT], OS_ALL), | |
| 182 'DefaultNotificationsSetting': | |
| 183 ('kManagedDefaultNotificationsSetting', 2, [CONTENT], OS_ALL), | |
| 184 'DefaultGeolocationSetting': | |
| 185 ('kManagedDefaultGeolocationSetting', 2, [CONTENT], OS_ALL), | |
| 186 'DefaultMediaStreamSetting': | |
| 187 ('kManagedDefaultMediaStreamSetting', 2, [CONTENT], OS_ALL), | |
| 188 'AutoSelectCertificateForUrls': | |
| 189 ('kManagedAutoSelectCertificateForUrls', | |
| 190 ['{\'pattern\':\'https://example.com\',' + | |
| 191 '\'filter\':{\'ISSUER\':{\'CN\': \'issuer-name\'}}}'], [], OS_ALL), | |
| 192 'CookiesAllowedForUrls': | |
| 193 ('kManagedCookiesAllowedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 194 'CookiesBlockedForUrls': | |
| 195 ('kManagedCookiesBlockedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 196 'CookiesSessionOnlyForUrls': | |
| 197 ('kManagedCookiesSessionOnlyForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 198 'ImagesAllowedForUrls': | |
| 199 ('kManagedImagesAllowedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 200 'ImagesBlockedForUrls': | |
| 201 ('kManagedImagesBlockedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 202 'JavaScriptAllowedForUrls': | |
| 203 ('kManagedJavaScriptAllowedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 204 'JavaScriptBlockedForUrls': | |
| 205 ('kManagedJavaScriptBlockedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 206 'PluginsAllowedForUrls': | |
| 207 ('kManagedPluginsAllowedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 208 'PluginsBlockedForUrls': | |
| 209 ('kManagedPluginsBlockedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 210 'PopupsAllowedForUrls': | |
| 211 ('kManagedPopupsAllowedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 212 'PopupsBlockedForUrls': | |
| 213 ('kManagedPopupsBlockedForUrls', ['[*.]google.com'], [], OS_ALL), | |
| 214 'NotificationsAllowedForUrls': | |
| 215 ('kManagedNotificationsAllowedForUrls', ['[*.]google.com'], [], | |
| 216 OS_ALL), | |
| 217 'NotificationsBlockedForUrls': | |
| 218 ('kManagedNotificationsBlockedForUrls', ['[*.]google.com'], [], | |
| 219 OS_ALL), | |
| 220 'Disable3DAPIs': ('kDisable3DAPIs', True, [], OS_ALL), | |
| 221 'InstantEnabled': ('kInstantEnabled', False, [BROWSER], OS_ALL), | |
| 222 'TranslateEnabled': ('kEnableTranslate', False, [BROWSER], OS_ALL), | |
| 223 'AllowOutdatedPlugins': ('kPluginsAllowOutdated', False, [], OS_ALL), | |
| 224 'AlwaysAuthorizePlugins': ('kPluginsAlwaysAuthorize', True, [], OS_ALL), | |
| 225 'BookmarkBarEnabled': ('kShowBookmarkBar', False, [BROWSER], OS_ALL), | |
| 226 'EditBookmarksEnabled': ('kEditBookmarksEnabled', False, [], OS_ALL), | |
| 227 'AllowFileSelectionDialogs': | |
| 228 ('kAllowFileSelectionDialogs', False, [BROWSER], | |
| 229 ['win', 'mac', 'linux']), | |
| 230 'ImportBookmarks': | |
| 231 ('kImportBookmarks', False, [], ['win', 'mac', 'linux']), | |
| 232 'ImportHistory': | |
| 233 ('kImportHistory', False, [], ['win', 'mac', 'linux']), | |
| 234 'ImportHomepage': | |
| 235 ('kImportHomepage', False, [], ['win', 'mac', 'linux']), | |
| 236 'ImportSearchEngine': | |
| 237 ('kImportSearchEngine', False, [], ['win', 'mac', 'linux']), | |
| 238 'ImportSavedPasswords': | |
| 239 ('kImportSavedPasswords', False, [], ['win', 'mac', 'linux']), | |
| 240 'MaxConnectionsPerProxy': ('kMaxConnectionsPerProxy', 32, [], OS_ALL), | |
| 241 'HideWebStorePromo': (None, True, [], OS_ALL), | |
| 242 'URLBlacklist': ('kUrlBlacklist', ['google.com'], [], OS_ALL), | |
| 243 'URLWhitelist': ('kUrlWhitelist', ['google.com'], [], OS_ALL), | |
| 244 'EnterpriseWebStoreURL': ('kEnterpriseWebStoreURL', '', [], OS_ALL), | |
| 245 'EnterpriseWebStoreName': ('kEnterpriseWebStoreName', '', [], OS_ALL), | |
| 246 'EnableMemoryInfo': ('kEnableMemoryInfo', True, [], OS_ALL), | |
| 247 'DisablePrintPreview': | |
| 248 ('kPrintPreviewDisabled', True, [], ['win', 'mac', 'linux']), | |
| 249 'BackgroundModeEnabled': | |
| 250 ('kBackgroundModeEnabled', True, [BROWSER], ['win', 'linux']), | |
| 251 'RestrictSigninToPattern': ('kGoogleServicesUsernamePattern', | |
| 252 '.*@google.com', [], ['win', 'mac', 'linux']), | |
| 253 'DisableSafeBrowsingProceedAnyway': | |
| 254 ('kSafeBrowsingProceedAnywayDisabled', True, [], OS_ALL), | |
| 255 # TODO(joaodasilva): this policy affects the BROWSER settings page but | |
| 256 # is only included in official builds. | |
| 257 'SpellCheckServiceEnabled': | |
| 258 ('kSpellCheckUseSpellingService', False, [], OS_ALL), | |
| 259 'DisableScreenshots': ('kDisableScreenshots', False, [], OS_ALL), | |
| 260 | |
| 261 # ChromeOS-only policies: | |
| 262 # TODO(frankf): Add prefs for these after crosbug.com/28756 is fixed. | |
| 263 'ChromeOsLockOnIdleSuspend': | |
| 264 (None, True, [BROWSER], ['chromeos']), | |
| 265 'PolicyRefreshRate': | |
| 266 (None, 300000, [], ['chromeos']), | |
| 267 'OpenNetworkConfiguration': (None, '', [], ['chromeos']), | |
| 268 'GDataDisabled': (None, True, [], ['chromeos']), | |
| 269 'GDataDisabledOverCellular': | |
| 270 (None, True, [], ['chromeos']), | |
| 271 'PinnedLauncherApps': (None, [], [], ['chromeos']), | |
| 272 'ExternalStorageDisabled': (None, True, [], ['chromeos']), | |
| 273 'AudioOutputAllowed': (None, True, [], ['chromeos']), | |
| 274 'AudioCaptureAllowed': (None, True, [], ['chromeos']), | |
| 275 | |
| 276 # ChromeOS Device policies: | |
| 277 'DevicePolicyRefreshRate': (None, 300000, [], ['chromeos']), | |
| 278 'ChromeOsReleaseChannel': (None, 'stable-channel', [], ['chromeos']), | |
| 279 'ChromeOsReleaseChannelDelegated': (None, False, [], ['chromeos']), | |
| 280 'DeviceOpenNetworkConfiguration': (None, '', [], ['chromeos']), | |
| 281 'ReportDeviceVersionInfo': (None, True, [], ['chromeos']), | |
| 282 'ReportDeviceActivityTimes': (None, True, [], ['chromeos']), | |
| 283 'ReportDeviceBootMode': (None, True, [], ['chromeos']), | |
| 284 'DeviceAllowNewUsers': (None, True, [], ['chromeos']), | |
| 285 'DeviceUserWhitelist': (None, [], [], ['chromeos']), | |
| 286 'DeviceGuestModeEnabled': (None, True, [], ['chromeos']), | |
| 287 'DeviceShowUserNamesOnSignin': (None, True, [], ['chromeos']), | |
| 288 'DeviceDataRoamingEnabled': (None, True, [], ['chromeos']), | |
| 289 'DeviceMetricsReportingEnabled': (None, True, [], ['chromeos']), | |
| 290 'DeviceEphemeralUsersEnabled': (None, True, [], ['chromeos']), | |
| 291 'DeviceIdleLogoutTimeout': (None, 60000, [], ['chromeos']), | |
| 292 'DeviceIdleLogoutWarningDuration': (None, 15000, [], ['chromeos']), | |
| 293 'DeviceLoginScreenSaverId': | |
| 294 (None, 'lcncmkcnkcdbbanbjakcencbaoegdjlp', [], ['chromeos']), | |
| 295 'DeviceLoginScreenSaverTimeout': (None, 30000, [], ['chromeos']), | |
| 296 'DeviceStartUpUrls': (None, ['http://google.com'], [], ['chromeos']), | |
| 297 'DeviceAppPack': (None, [], [], ['chromeos']), | |
| 298 'DeviceAutoUpdateDisabled': (None, True, [], ['chromeos']), | |
| 299 'DeviceTargetVersionPrefix': (None, '1412.', [], ['chromeos']), | |
| 300 'DeviceUpdateScatterFactor': (None, '7200', [], ['chromeos']), | |
| 301 'DeviceUpdateAllowedConnectionTypes': (None, [], [], ['chromeos']), | |
| 302 'ReportDeviceLocation': (None, False, [], ['chromeos']), | |
| 303 'SystemTimezone': (None, 'Europe/Brussels', [], ['chromeos']), | |
| 304 | |
| 305 # Chrome Frame policies: | |
| 306 'ChromeFrameRendererSettings': (None, 0, [], []), | |
| 307 'RenderInChromeFrameList': (None, ['google.com'], [], []), | |
| 308 'RenderInHostList': (None, ['google.com'], [], []), | |
| 309 'ChromeFrameContentTypes': (None, ['text/xml'], [], []), | |
| 310 'GCFUserDataDir': (None, '${user_name}/test-frame', [], []), | |
| 311 'AdditionalLaunchParameters': (None, '--enable-media-stream', [], []), | |
| 312 } | |
| OLD | NEW |