OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import pyauto_functional # Must come before pyauto (and thus, policy_base). | 7 import pyauto_functional # Must come before pyauto (and thus, policy_base). |
8 import policy_base | 8 import policy_base |
9 | 9 |
10 | 10 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 | 228 |
229 self.SetDevicePolicy({'show_user_names': True, | 229 self.SetDevicePolicy({'show_user_names': True, |
230 'user_whitelist': [self._usernames[1]]}) | 230 'user_whitelist': [self._usernames[1]]}) |
231 self._WaitForPodVisibility(username=self._usernames[0], visible=False) | 231 self._WaitForPodVisibility(username=self._usernames[0], visible=False) |
232 self._WaitForPodVisibility(username=self._usernames[1], visible=True) | 232 self._WaitForPodVisibility(username=self._usernames[1], visible=True) |
233 | 233 |
234 self.SetDevicePolicy({'show_user_names': True}) | 234 self.SetDevicePolicy({'show_user_names': True}) |
235 self._WaitForPodVisibility(username=self._usernames[0], visible=True) | 235 self._WaitForPodVisibility(username=self._usernames[0], visible=True) |
236 self._WaitForPodVisibility(username=self._usernames[1], visible=True) | 236 self._WaitForPodVisibility(username=self._usernames[1], visible=True) |
237 | 237 |
238 def SetTimezoneInCrosSettings(self, timezone): | |
Joao da Silva
2012/07/27 13:40:57
Private methods' names start with _.
pneubeck (no reviews)
2012/07/31 22:21:05
Done.
| |
239 self.SetCrosSetting('cros.system.timezone', timezone) | |
240 | |
241 _timezones = ['America/Barbados', 'Europe/Helsinki'] | |
242 | |
243 def testTimezoneSettingWithoutPolicy(self): | |
244 """Without timezone policy, timezone changes by user are persistent.""" | |
245 self.SetDevicePolicy(refresh=False) | |
246 | |
247 for timezone in self._timezones: | |
248 self.Login(user_index=1, expect_success=True) | |
249 self.SetTimezoneInCrosSettings(timezone) | |
250 self.assertEqual(timezone, self.GetTimeInfo()['timezone']) | |
251 | |
252 self.Logout() | |
253 self.assertEqual(timezone, self.GetTimeInfo()['timezone']) | |
254 | |
255 def testTimezoneSettingWithPolicy(self): | |
256 """With timezone policy, timezone changes by user are reset on logout.""" | |
257 self.SetDevicePolicy({'timezone':self._timezones[0]}, refresh=True) | |
258 | |
259 # Timezones are set on startup, i.e. everytime when loading the login | |
260 # screen. Something like a browser restart may work, too. | |
261 self.Login(user_index=1, expect_success=True) | |
262 self.Logout() | |
263 | |
264 self.assertEqual(self._timezones[0], self.GetTimeInfo()['timezone']) | |
265 | |
266 self.Login(user_index=1, expect_success=True) | |
267 self.SetTimezoneInCrosSettings(self._timezones[1]) | |
Joao da Silva
2012/07/27 13:40:57
It seems to me that both uses of SetTimezoneInCros
pneubeck (no reviews)
2012/08/06 14:50:48
Done.
| |
268 self.assertEqual(self._timezones[1], self.GetTimeInfo()['timezone']) | |
269 | |
270 self.Logout() | |
271 self.assertEqual(self._timezones[0], self.GetTimeInfo()['timezone']) | |
238 | 272 |
239 if __name__ == '__main__': | 273 if __name__ == '__main__': |
240 pyauto_functional.Main() | 274 pyauto_functional.Main() |
OLD | NEW |