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

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: Created 8 years, 5 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
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..8ad8f0fa82ead840a8e79b23ca1968b0ee79f4c7 100755
--- a/chrome/test/functional/chromeos_time.py
+++ b/chrome/test/functional/chromeos_time.py
@@ -68,6 +68,29 @@ class ChromeosTime(pyauto.PyUITest):
editable = self._IsTimezoneEditable()
self.assertTrue(editable, msg='Timezone is not editable when not owner.')
+ 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."""
+
+ #self.Login(user_index=1, expect_success=True)
Joao da Silva 2012/07/27 13:40:57 Remove?
pneubeck (no reviews) 2012/07/31 22:21:05 Done.
+ for timezone in ['America/Barbados', 'Europe/Helsinki']:
+ self._SetTimezoneInUI(timezone)
+ self.assertTrue(
+ self.WaitUntil(lambda: timezone == self.GetTimeInfo()['timezone']),
Joao da Silva 2012/07/27 13:40:57 Nit: indent
pneubeck (no reviews) 2012/07/31 22:21:05 ah. My emacs mode is not configured correctly :-)
pneubeck (no reviews) 2012/07/31 22:21:05 Done.
+ 'Timezone not changed as expected.');
+
+ 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)
if __name__ == '__main__':
pyauto_functional.Main()

Powered by Google App Engine
This is Rietveld 408576698