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

Unified Diff: chrome/test/functional/chromeos_time.py

Issue 10827050: Added a timezone policy and pyauto tests for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/functional/chromeos_device_policy.py ('k') | chrome/test/functional/policy_test_cases.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/chromeos_time.py
diff --git a/chrome/test/functional/chromeos_time.py b/chrome/test/functional/chromeos_time.py
index 8cb99ca6bb47b7c02c5462b07fb72063a24380c0..644961ca43ea3da2b04bc308c85ba89338cb7516 100755
--- a/chrome/test/functional/chromeos_time.py
+++ b/chrome/test/functional/chromeos_time.py
@@ -68,6 +68,28 @@ class ChromeosTime(pyauto.PyUITest):
editable = self._IsTimezoneEditable()
self.assertTrue(editable, msg='Timezone is not editable when not owner.')
+ def _SetTimezoneInUI(self, timezone):
+ self.NavigateToURL('chrome://settings-frame/settings')
+ self.ExecuteJavascript("""
+ var selectElement = document.getElementById('timezone-select');
+ selectElement.value = "%s";
+ var event = document.createEvent("HTMLEvents");
+ event.initEvent("change", true, true);
+ selectElement.dispatchEvent(event);
+ domAutomationController.send("");
+ """ % timezone)
+
+ def testSetTimezoneUI(self):
+ """Test that the timezone UI changes internal settings.
+
+ Set the Timezone on the settings page. Check the internal timezone
+ afterwards. Timezones should be always editable."""
+
+ for timezone in ['America/Barbados', 'Europe/Helsinki']:
+ self._SetTimezoneInUI(timezone)
+ self.assertTrue(
+ self.WaitUntil(lambda: timezone == self.GetTimeInfo()['timezone']),
+ 'Timezone not changed as expected.');
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « chrome/test/functional/chromeos_device_policy.py ('k') | chrome/test/functional/policy_test_cases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698