summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 22:34:18 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 22:34:18 +0000
commit465ef4fdb56d933c00c9939aebfe891ae6c8ec79 (patch)
treed08dae39e48bc609ece652a88feb1619047da5ea /chrome/test
parent74ddb63b51aadad80a1f00e6fa6746eb31d3cc71 (diff)
downloadchromium_src-465ef4fdb56d933c00c9939aebfe891ae6c8ec79.zip
chromium_src-465ef4fdb56d933c00c9939aebfe891ae6c8ec79.tar.gz
chromium_src-465ef4fdb56d933c00c9939aebfe891ae6c8ec79.tar.bz2
Setting omnibox string to '' for WaitUntil waiting
Review URL: http://codereview.chromium.org/6038003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/functional/omnibox.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/chrome/test/functional/omnibox.py b/chrome/test/functional/omnibox.py
index 548030d..fa716ca 100644
--- a/chrome/test/functional/omnibox.py
+++ b/chrome/test/functional/omnibox.py
@@ -280,14 +280,19 @@ class OmniboxTest(pyauto.PyUITest):
def _GotNewMatches(self, old_matches_len, search_text):
"""Determines if omnibox has any new matches"""
- new_matches = self._GetOmniboxMatchesFor(search_text)
+ # On Windows, omnibox doesn't change results if searching the same text
+ # repeatedly. So setting '' in omnibox before any search for non-Mac
+ # platforms.
+ if not self.IsMac():
+ self.SetOmniboxText('')
+ new_matches = self._GetOmniboxMatchesFor(search_text)
if len(new_matches) > old_matches_len:
return True
return False
- def testContentHisotry(self):
+ def testContentHistory(self):
"""Verify omnibox results when entering page content
-
+
Test verifies that visited page shows up in omnibox on entering page
content.
"""
@@ -306,14 +311,16 @@ class OmniboxTest(pyauto.PyUITest):
"""Verify that omnibox shows recent history option in the visited
url list."""
search_text = 'file'
- sites = glob.glob(os.path.join(self.DataDir(), 'find_in_page', '*.html'))
+ sites = glob.glob(os.path.join(self.DataDir(), 'find_in_page', '*.html'))
for site in sites:
self.NavigateToURL(self.GetFileURLForPath(site))
old_matches = self._GetOmniboxMatchesFor(search_text)
- # Using max timeout as 40 seconds, since expected page only shows up
- # after 40 seconds and default timeout is less than that.
+ # Using max timeout as 60 seconds, since expected page only shows up
+ # after 60 seconds and default timeout is less than that.
+ # TODO (Nirnimesh): design an api using which we can push history changes to
+ # omnibox results.
self.assertTrue(self.WaitUntil(
- lambda: self._GotNewMatches(len(old_matches), search_text), timeout=40))
+ lambda: self._GotNewMatches(len(old_matches), search_text), timeout=60))
matches = self._GetOmniboxMatchesFor(search_text)
matches_description = [x for x in matches if x['type'] ==
'open-history-page']