summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordyu@chromium.org <dyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 22:09:09 +0000
committerdyu@chromium.org <dyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 22:09:09 +0000
commit649945c386e7c84314308c85163506e04aaeaaef (patch)
tree920591c45213c3081a44b86dfd6e87bc8c735f1a /chrome
parent64ad22e9c757b5aaa763bf10a6945957bcd4fd6e (diff)
downloadchromium_src-649945c386e7c84314308c85163506e04aaeaaef.zip
chromium_src-649945c386e7c84314308c85163506e04aaeaaef.tar.gz
chromium_src-649945c386e7c84314308c85163506e04aaeaaef.tar.bz2
Add integration tests for instant.py.
- testPreFetchInstantURLNotInHistory - testPreFetchInstantURLGeneratesNoPopups - testPreFetchInstantURLSetsNoCookies BUG=none TEST=none Review URL: http://codereview.chromium.org/7033039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/test/functional/instant.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/test/functional/instant.py b/chrome/test/functional/instant.py
index abc1088..917b10f 100644
--- a/chrome/test/functional/instant.py
+++ b/chrome/test/functional/instant.py
@@ -192,6 +192,31 @@ class InstantTest(pyauto.PyUITest):
self.CloseBrowserWindow(1)
self.assertEqual(self.GetActiveTabTitle(), 'about:blank')
+ def testPreFetchInstantURLNotInHistory(self):
+ """Test that pre-fetched URLs are not saved in History."""
+ self._BringUpInstant()
+ history = self.GetHistoryInfo().History()
+ self.assertFalse(history, msg='Pre-feteched URL saved in History')
+
+ def testPreFetchInstantURLGeneratesNoPopups(self):
+ """Test that pre-fetched URL does not generate popups."""
+ file_url = self.GetHttpURLForDataPath('pyauto_private', 'popup_blocker',
+ 'PopupTest1.html')
+ # Set the preference to allow all sites to show popups.
+ self.SetPrefs(pyauto.kDefaultContentSettings, {u'popups': 1})
+ self.SetOmniboxText(file_url)
+ self.WaitUntilOmniboxQueryDone()
+ self.assertEqual(1, self.GetBrowserWindowCount(),
+ msg='Pre-fetched URL generated popups.')
+
+ def testPreFetchInstantURLSetsNoCookies(self):
+ """Test that pre-fetched URL does not set cookies."""
+ file_url = self.GetHttpURLForDataPath('cookie1.html')
+ self.SetOmniboxText(file_url)
+ self.WaitUntilOmniboxQueryDone()
+ cookie_data = self.GetCookie(pyauto.GURL(file_url))
+ self.assertFalse(cookie_data, msg='Cookie set for pre-fetched instant URL')
+
def _AssertInstantDoesNotDownloadFile(self, path):
"""Asserts instant does not download the specified file.