OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging | 5 import logging |
6 | 6 |
7 from pylib import content_settings | 7 from pylib import content_settings |
8 | 8 |
9 | 9 |
10 def ConfigureContentSettingsDict(device, desired_settings): | 10 def ConfigureContentSettingsDict(device, desired_settings): |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 for table, key_value in sorted(desired_settings.iteritems()): | 41 for table, key_value in sorted(desired_settings.iteritems()): |
42 settings = content_settings.ContentSettings(table, device) | 42 settings = content_settings.ContentSettings(table, device) |
43 for key, value in key_value.iteritems(): | 43 for key, value in key_value.iteritems(): |
44 settings[key] = value | 44 settings[key] = value |
45 logging.info('\n%s %s', table, (80 - len(table)) * '-') | 45 logging.info('\n%s %s', table, (80 - len(table)) * '-') |
46 for key, value in sorted(settings.iteritems()): | 46 for key, value in sorted(settings.iteritems()): |
47 logging.info('\t%s: %s', key, value) | 47 logging.info('\t%s: %s', key, value) |
48 | 48 |
49 | 49 |
| 50 ENABLE_LOCATION_SETTING = { |
| 51 'settings/secure': { |
| 52 # Ensure Geolocation is enabled and allowed for tests. |
| 53 'location_providers_allowed': 'gps,network', |
| 54 } |
| 55 } |
| 56 |
| 57 DISABLE_LOCATION_SETTING = { |
| 58 'settings/secure': { |
| 59 # Ensure Geolocation is disabled. |
| 60 'location_providers_allowed': '', |
| 61 } |
| 62 } |
| 63 |
50 DETERMINISTIC_DEVICE_SETTINGS = { | 64 DETERMINISTIC_DEVICE_SETTINGS = { |
51 'com.google.settings/partner': { | 65 'com.google.settings/partner': { |
52 'network_location_opt_in': 0, | 66 'network_location_opt_in': 0, |
53 'use_location_for_services': 1, | 67 'use_location_for_services': 1, |
54 }, | 68 }, |
55 'settings/global': { | 69 'settings/global': { |
56 'assisted_gps_enabled': 0, | 70 'assisted_gps_enabled': 0, |
57 | 71 |
58 # Disable "auto time" and "auto time zone" to avoid network-provided time | 72 # Disable "auto time" and "auto time zone" to avoid network-provided time |
59 # to overwrite the device's datetime and timezone synchronized from host | 73 # to overwrite the device's datetime and timezone synchronized from host |
(...skipping 16 matching lines...) Expand all Loading... |
76 'settings/secure': { | 90 'settings/secure': { |
77 'allowed_geolocation_origins': | 91 'allowed_geolocation_origins': |
78 'http://www.google.co.uk http://www.google.com', | 92 'http://www.google.co.uk http://www.google.com', |
79 | 93 |
80 # Ensure that we never get random dialogs like "Unfortunately the process | 94 # Ensure that we never get random dialogs like "Unfortunately the process |
81 # android.process.acore has stopped", which steal the focus, and make our | 95 # android.process.acore has stopped", which steal the focus, and make our |
82 # automation fail (because the dialog steals the focus then mistakenly | 96 # automation fail (because the dialog steals the focus then mistakenly |
83 # receives the injected user input events). | 97 # receives the injected user input events). |
84 'anr_show_background': 0, | 98 'anr_show_background': 0, |
85 | 99 |
86 # Ensure Geolocation is enabled and allowed for tests. | |
87 'location_providers_allowed': 'gps,network', | |
88 | |
89 'lockscreen.disabled': 1, | 100 'lockscreen.disabled': 1, |
90 | 101 |
91 'screensaver_enabled': 0, | 102 'screensaver_enabled': 0, |
92 }, | 103 }, |
93 'settings/system': { | 104 'settings/system': { |
94 # Don't want devices to accidentally rotate the screen as that could | 105 # Don't want devices to accidentally rotate the screen as that could |
95 # affect performance measurements. | 106 # affect performance measurements. |
96 'accelerometer_rotation': 0, | 107 'accelerometer_rotation': 0, |
97 | 108 |
98 'lockscreen.disabled': 1, | 109 'lockscreen.disabled': 1, |
99 | 110 |
100 # Turn down brightness and disable auto-adjust so that devices run cooler. | 111 # Turn down brightness and disable auto-adjust so that devices run cooler. |
101 'screen_brightness': 5, | 112 'screen_brightness': 5, |
102 'screen_brightness_mode': 0, | 113 'screen_brightness_mode': 0, |
103 | 114 |
104 'user_rotation': 0, | 115 'user_rotation': 0, |
105 }, | 116 }, |
106 } | 117 } |
107 | 118 |
108 | 119 |
109 NETWORK_DISABLED_SETTINGS = { | 120 NETWORK_DISABLED_SETTINGS = { |
110 'settings/global': { | 121 'settings/global': { |
111 'airplane_mode_on': 1, | 122 'airplane_mode_on': 1, |
112 'wifi_on': 0, | 123 'wifi_on': 0, |
113 }, | 124 }, |
114 } | 125 } |
OLD | NEW |