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

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 124824)
+++ chrome/test/functional/prefs_ui.py (working copy)
@@ -42,22 +42,26 @@
behavior_key))
return behaviors_dict[behavior_key]
- def _VerifyContentExceptionUI(self, content_type, hostname_pattern, behavior):
+ def _VerifyContentExceptionUI(self, content_type, hostname_pattern, behavior,
+ incognito=False):
"""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.
+ incognito: Incognito list displayed on exceptions settings page.
+ Default to False.
"""
page = settings.ManageExceptionsPage.FromNavigation(
self._driver, content_type)
- self.assertTrue(page.GetExceptions().has_key(hostname_pattern),
+ self.assertTrue(page.GetExceptions(incognito).has_key(hostname_pattern),
msg=('No displayed host name matches pattern "%s"'
% hostname_pattern))
- self.assertEqual(behavior, page.GetExceptions()[hostname_pattern],
+ self.assertEqual(behavior, page.GetExceptions(incognito)[hostname_pattern],
msg=('Displayed behavior "%s" does not match behavior "%s"'
- % (page.GetExceptions()[hostname_pattern], behavior)))
+ % (page.GetExceptions(incognito)[hostname_pattern],
+ behavior)))
def testLocationSettingOptionsUI(self):
"""Verify the location options setting UI.
@@ -165,6 +169,32 @@
self._driver, ContentTypes.GEOLOCATION)
self.assertEqual(0, len(page.GetExceptions()))
+ def testCorrectCookiesSessionInUI(self):
+ """Verify exceptions for cookies in UI list entry."""
+ # Block cookies for for a session for google.com.
+ self.SetPrefs(pyauto.kContentSettingsPatternPairs,
+ {'http://google.com:80': {'cookies': 2}})
+ self._VerifyContentExceptionUI(
+ ContentTypes.COOKIES, 'http://google.com:80', Behaviors.BLOCK)
+ def testInitialLineEntryInIncognitoUI(self):
+ """Verify initial line entry is displayed in Incognito UI."""
+ self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) # Display incognito list.
+ page = settings.ManageExceptionsPage.FromNavigation(
+ self._driver, ContentTypes.PLUGINS)
+ self.assertEqual(1, len(page.GetExceptions(incognito=True)))
+
+ def testIncognitoExceptionsEntryCorrectlyDisplayed(self):
+ """Verify exceptions entry is correctly displayed in the incognito UI."""
+ self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) # Display incognito list.
+ page = settings.ManageExceptionsPage.FromNavigation(
+ self._driver, ContentTypes.PLUGINS)
+ pattern, behavior = ('http://maps.google.com:80', Behaviors.BLOCK)
+ page.AddNewException(pattern, behavior, incognito=True)
+ self._VerifyContentExceptionUI(
+ ContentTypes.PLUGINS, 'http://maps.google.com:80',
+ Behaviors.BLOCK, 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