Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Side by Side Diff: chrome/test/functional/policy_test_cases.py

Issue 9791023: Allow setting of user and device policies in functional tests (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments addressed. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/functional/policy_prefs_ui.py ('k') | chrome/test/pyautolib/asn1der.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # This data is in a separate file so that src/chrome/app/policy/PRESUBMIT.py 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. 7 # can load it too without having to load pyautolib.
8 8
9 # DO NOT import pyauto from here! This file is required to run a presubmit 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. 10 # scripts that will always fail if pyautolib isn't available, which is common.
11 11
12 12
13 class PolicyPrefsTestCases(object): 13 class PolicyPrefsTestCases(object):
14 """A list of test cases for policy_prefs_ui.py.""" 14 """A list of test cases for policy_prefs_ui.py."""
15 15
16 [BROWSER, SEARCH_ENGINES, PASSWORDS, AUTOFILL, CONTENT, HOMEPAGE, LANGUAGES, 16 [BROWSER, SEARCH_ENGINES, PASSWORDS, AUTOFILL, CONTENT, HOMEPAGE, LANGUAGES,
17 ACCOUNTS] = range(8) 17 ACCOUNTS] = range(8)
18 18
19 # Each policy has an entry with a tuple (Pref, Value, Pages, OS) 19 # Each policy has an entry with a tuple (Pref, Value, Pages, OS)
20 # 20 #
21 # |Pref| is the preference key for simple policies that map directly to a 21 # |Pref| is the preference key for simple user policies that map directly to a
22 # preference (Refer to 22 # preference (Refer to
23 # chrome/browser/policy/configuration_policy_handler_list.cc). 23 # chrome/browser/policy/configuration_policy_handler_list.cc).
24 # Otherwise, set as None. 24 # Otherwise, set as None.
25 # 25 #
26 # |Value| is the value the policy should have when it is enforced. 26 # |Value| is the value the policy should have when it is enforced.
27 # 27 #
28 # |Pages| is a list with integer indices into |settings_pages|, and lists all 28 # |Pages| is a list with integer indices into |settings_pages|, and lists all
29 # the pages that should display the managed-banner. 29 # the pages that should display the managed-banner.
30 # Leave empty if this policy doesn't display anything visible in 30 # Leave empty if this policy doesn't display anything visible in
31 # the settings. 31 # the settings.
32 # 32 #
33 # |OS| is a list of platforms where this policy should be tested. Valid 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 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 35 # empty to skip the policy or set to OS_ALL if applicable to all
36 # platforms. 36 # platforms.
37 #
38 # ChromeOS device policies are also listed but are currently not tested by
39 # policy_prefs_ui.py.
37 [INDEX_PREF, INDEX_VALUE, INDEX_PAGES, INDEX_OS] = range(4) 40 [INDEX_PREF, INDEX_VALUE, INDEX_PAGES, INDEX_OS] = range(4)
38 OS_ALL = ['win', 'mac', 'linux', 'chromeos'] 41 OS_ALL = ['win', 'mac', 'linux', 'chromeos']
39 policies = { 42 policies = {
40 'HomepageLocation': 43 'HomepageLocation':
41 ('kHomePage', 'http://chromium.org', [HOMEPAGE], OS_ALL), 44 ('kHomePage', 'http://chromium.org', [HOMEPAGE], OS_ALL),
42 'HomepageIsNewTabPage': 45 'HomepageIsNewTabPage':
43 ('kHomePageIsNewTabPage', True, [HOMEPAGE], OS_ALL), 46 ('kHomePageIsNewTabPage', True, [HOMEPAGE], OS_ALL),
44 # TODO(joaodasilva): Couldn't verify on linux. 47 # TODO(joaodasilva): Couldn't verify on linux.
45 'DefaultBrowserSettingEnabled': 48 'DefaultBrowserSettingEnabled':
46 ('kDefaultBrowserSettingEnabled', False, [], ['win', 'mac', 'linux']), 49 ('kDefaultBrowserSettingEnabled', False, [], ['win', 'mac', 'linux']),
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 'DeviceAutoUpdateDisabled': (None, True, [], ['chromeos']), 273 'DeviceAutoUpdateDisabled': (None, True, [], ['chromeos']),
271 274
272 # Chrome Frame policies: 275 # Chrome Frame policies:
273 'ChromeFrameRendererSettings': (None, 0, [], []), 276 'ChromeFrameRendererSettings': (None, 0, [], []),
274 'RenderInChromeFrameList': (None, ['google.com'], [], []), 277 'RenderInChromeFrameList': (None, ['google.com'], [], []),
275 'RenderInHostList': (None, ['google.com'], [], []), 278 'RenderInHostList': (None, ['google.com'], [], []),
276 'ChromeFrameContentTypes': (None, ['text/xml'], [], []), 279 'ChromeFrameContentTypes': (None, ['text/xml'], [], []),
277 'GCFUserDataDir': (None, '${user_name}/test-frame', [], []), 280 'GCFUserDataDir': (None, '${user_name}/test-frame', [], []),
278 'AdditionalLaunchParameters': (None, '--enable-media-stream', [], []), 281 'AdditionalLaunchParameters': (None, '--enable-media-stream', [], []),
279 } 282 }
OLDNEW
« no previous file with comments | « chrome/test/functional/policy_prefs_ui.py ('k') | chrome/test/pyautolib/asn1der.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698