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

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

Issue 9467013: Add prefs UI tests for Incognito exceptions for new Settings UI. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | chrome/test/functional/webdriver_pages/settings.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/prefs_ui.py
===================================================================
--- chrome/test/functional/prefs_ui.py (revision 123578)
+++ chrome/test/functional/prefs_ui.py (working copy)
@@ -59,6 +59,26 @@
msg=('Displayed behavior "%s" does not match behavior "%s"'
% (page.GetExceptions()[hostname_pattern], behavior)))
+ def _VerifyIncognitoContentExceptionUI(
+ self, content_type, hostname_pattern, behavior):
+ """Find hostname pattern and behavior within UI on content exceptions page.
+
+ Args:
+ content_type: The string content settings type to manage.
+ hostname_pattern: The URL or pattern associated with the behavior.
+ behavior: The exception to allow or block the hostname.
+ """
+ page = settings.ManageExceptionsPage.FromNavigation(
+ self._driver, content_type)
+ self.assertTrue(
+ page.GetExceptions(incognito=True).has_key(hostname_pattern),
+ msg=('No displayed host name matches pattern "%s"' % hostname_pattern))
Nirnimesh 2012/02/24 23:49:47 remove inner params
dyu1 2012/02/27 20:54:45 Done.
+ self.assertEqual(
+ behavior, page.GetExceptions(incognito=True)[hostname_pattern],
+ msg=('Displayed behavior "%s" does not match behavior "%s"'
+ % (page.GetExceptions(incognito=True)[hostname_pattern],
+ behavior)))
+
def testLocationSettingOptionsUI(self):
"""Verify the location options setting UI.
@@ -114,6 +134,26 @@
self._VerifyContentExceptionUI(
ContentTypes.GEOLOCATION, 'http://maps.google.com:80', Behaviors.ASK)
+ def testIncognitoExceptionsEntryCorrectlyDisplayed(self):
+ """Verify exceptions entry is correctly displayed in the incognito UI."""
+ geo_exception = (
+ {'http://maps.google.com:80/': {'http://maps.google.com': 2}})
+ self.SetPrefs(pyauto.kGeolocationContentSettings, geo_exception)
+ self._VerifyIncognitoContentExceptionUI(
+ ContentTypes.GEOLOCATION, 'http://maps.google.com:80',
+ Behaviors.BLOCK)
+ geo_exception = (
+ {'http://maps.google.com:80/': {'http://maps.google.com:80': 1}})
+ self.SetPrefs(pyauto.kGeolocationContentSettings, geo_exception)
+ self._VerifyIncognitoContentExceptionUI(
+ ContentTypes.GEOLOCATION, 'http://maps.google.com:80',
+ Behaviors.ALLOW)
+ geo_exception = (
+ {'http://maps.google.com:80/': {'http://maps.google.com:80': 3}})
+ self.SetPrefs(pyauto.kGeolocationContentSettings, geo_exception)
+ self._VerifyIncognitoContentExceptionUI(
+ ContentTypes.GEOLOCATION, 'http://maps.google.com:80', Behaviors.ASK)
+
def testAddNewExceptionUI(self):
"""Verify new exception added for hostname pattern and behavior in UI."""
content_type = ContentTypes.PLUGINS
@@ -165,6 +205,16 @@
self._driver, ContentTypes.GEOLOCATION)
self.assertEqual(0, len(page.GetExceptions()))
+ def testInitialLineEntryInIncognitoUI(self):
+ """Verify initial line entry is displayed in Incognito UI."""
+ # Ask for permission when site wants to track.
+ self.SetPrefs(pyauto.kGeolocationDefaultContentSetting, 3)
+ self.assertEqual(
+ 3, self.GetPrefsInfo().Prefs(pyauto.kGeolocationDefaultContentSetting))
+ page = settings.ManageExceptionsPage.FromNavigation(
+ self._driver, ContentTypes.GEOLOCATION)
+ self.assertEqual(1, len(page.GetExceptions(incognito=True)))
+
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « no previous file | chrome/test/functional/webdriver_pages/settings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698