| OLD | NEW |
| 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 import logging | 6 import logging |
| 7 | 7 |
| 8 import pyauto_functional # Must be imported before pyauto | 8 import pyauto_functional # Must be imported before pyauto |
| 9 import pyauto | 9 import pyauto |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 def _IsTimezoneEditable(self): | 36 def _IsTimezoneEditable(self): |
| 37 """Check if the timezone is editable. | 37 """Check if the timezone is editable. |
| 38 | 38 |
| 39 It will navigate to the system settings page and verify that the | 39 It will navigate to the system settings page and verify that the |
| 40 timezone settings drop down is not disabled. | 40 timezone settings drop down is not disabled. |
| 41 | 41 |
| 42 Returns: | 42 Returns: |
| 43 True, if timezone dropdown is enabled | 43 True, if timezone dropdown is enabled |
| 44 False, otherwise | 44 False, otherwise |
| 45 """ | 45 """ |
| 46 self.NavigateToURL('chrome://settings/system') | 46 self.NavigateToURL('chrome://settings-frame/advanced') |
| 47 ret = self.ExecuteJavascript(""" | 47 ret = self.ExecuteJavascript(""" |
| 48 var enabled = false; | 48 var enabled = false; |
| 49 var timezone = document.getElementById('timezone-select'); | 49 var timezone = document.getElementById('timezone-select'); |
| 50 if (timezone) | 50 if (timezone) |
| 51 enabled = banner.enabled; | 51 enabled = !timezone.disabled; |
| 52 domAutomationController.send(enabled.toString()); | 52 domAutomationController.send(enabled.toString()); |
| 53 """) | 53 """) |
| 54 return ret == 'true' | 54 return ret == 'true' |
| 55 | 55 |
| 56 def testTimezoneIsEditable(self): | 56 def testTimezoneIsEditable(self): |
| 57 """Test that the timezone is always editable.""" | 57 """Test that the timezone is always editable.""" |
| 58 # This test only makes sense if we are not running as the owner. | 58 # This test only makes sense if we are not running as the owner. |
| 59 self.assertFalse(self.GetLoginInfo()['is_owner']) | 59 self.assertFalse(self.GetLoginInfo()['is_owner']) |
| 60 enabled = _IsTimezoneEditable() | 60 enabled = self._IsTimezoneEditable() |
| 61 self.assertTrue(enabled, msg='Timezone is not editable when not owner.') | 61 self.assertTrue(enabled, msg='Timezone is not editable when not owner.') |
| 62 | 62 |
| 63 | 63 |
| 64 if __name__ == '__main__': | 64 if __name__ == '__main__': |
| 65 pyauto_functional.Main() | 65 pyauto_functional.Main() |
| OLD | NEW |