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

Unified Diff: functional/instant.py

Issue 6352003: Added one testcases to Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 9 years, 11 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/instant.py
===================================================================
--- functional/instant.py (revision 71508)
+++ functional/instant.py (working copy)
@@ -21,6 +21,16 @@
info = self.GetInstantInfo()
return info.get('current') and not info.get('loading')
+ def _CanDismissInstant(self):
+ test_dir = os.path.join(os.path.abspath(self.DataDir()), 'google')
+ file_path = os.path.join(test_dir, 'google.html')
+ file_url = self.GetFileURLForPath(file_path)
+ self.SetOmniboxText(file_url)
+ self.assertTrue(self.WaitUntil(self._DoneLoading))
+ location = self.GetInstantInfo()['location']
+ self.assertTrue('google.html' in location,
+ msg='No google.html in %s' % location)
+
def testInstantNavigation(self):
"""Test that instant navigates based on omnibox input."""
self.SetOmniboxText('google.com')
@@ -63,6 +73,29 @@
self.assertFalse(self.GetInstantInfo()['active'],
'Instant enabled for javascript URL.')
-
+ def testInstantCanDismiss(self):
+ """Test that instant preview is dismissed by
+ find-in-page, new tab page, extenions page, new window."""
+ #Test with find-in-page
+ self._CanDismissInstant()
+ self.OpenFindInPage()
+ self.assertEqual(self.GetActiveTabTitle(), '')
+ #Test with new tab page.
+ self._CanDismissInstant()
+ self.AppendTab(pyauto.GURL('chrome://newtab'))
+ self.RunCommand(pyauto.IDC_CLOSE_TAB)
+ self.assertEqual(self.GetActiveTabTitle(), '')
+ #Test with extensions page
+ self._CanDismissInstant()
+ self.AppendTab(pyauto.GURL('chrome://extensions'))
+ self.RunCommand(pyauto.IDC_CLOSE_TAB)
+ self.assertEqual(self.GetActiveTabTitle(), '')
+ #Test with new window
+ self._CanDismissInstant()
+ self.RunCommand(pyauto.IDC_NEW_WINDOW)
+ self.CloseBrowserWindow(1)
+ self.assertEqual(self.GetActiveTabTitle(), '')
+ self._CanDismissInstant()
+
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