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

Unified Diff: functional/enterprise.py

Issue 7671009: Added code to check for translate if policy is set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: functional/enterprise.py
===================================================================
--- functional/enterprise.py (revision 96969)
+++ functional/enterprise.py (working copy)
@@ -336,6 +336,21 @@
self.assertRaises(pyauto.JSONInterfaceError,
lambda: self.SetPrefs(pyauto.kManagedDefaultPopupsSetting, 1))
+ def testTranslateEnabled(self):
+ """Verify that translate happens if policy enables it."""
+ if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome':
+ return
+ self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kEnableTranslate))
+ url = self.GetFileURLForDataPath('translate', 'es', 'google.html')
+ self.NavigateToURL(url)
+ self.assertTrue(self.WaitForInfobarCount(1))
+ translate_info = self.GetTranslateInfo()
+ self.assertEqual('es', translate_info['original_language'])
+ self.assertFalse(translate_info['page_translated'])
+ self.assertTrue(translate_info['can_translate_page'])
+ self.assertTrue('translate_bar' in translate_info)
+ self._CheckIfPrefCanBeModified(pyauto.kEnableTranslate, True, False)
+
class EnterpriseTestReverse(pyauto.PyUITest):
"""Test for the Enterprise features that uses the opposite values of the
policies used by above test class 'EnterpriseTest'.
@@ -608,6 +623,16 @@
self.assertRaises(pyauto.JSONInterfaceError,
lambda: self.SetPrefs(pyauto.kManagedDefaultPopupsSetting, 2))
+ def testTranslateDisabled(self):
+ """Verify that translate does not happen if policy disables it."""
+ if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome':
+ return
+ self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kEnableTranslate))
+ url = self.GetFileURLForDataPath('translate', 'es', 'google.html')
+ self.NavigateToURL(url)
+ self.assertFalse(self.WaitForInfobarCount(1))
+ self._CheckIfPrefCanBeModified(pyauto.kEnableTranslate, False, True)
+
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698