diff options
author | rohitbm@google.com <rohitbm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 19:13:38 +0000 |
---|---|---|
committer | rohitbm@google.com <rohitbm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 19:13:38 +0000 |
commit | b163563dd4299e408aa785740dc305a7ad10b205 (patch) | |
tree | e0f71ea655f8110c6c06bcd4f50f1bc09394a1cc | |
parent | bb6aba3a90b104b7df841f15d00f6f31d580ac71 (diff) | |
download | chromium_src-b163563dd4299e408aa785740dc305a7ad10b205.zip chromium_src-b163563dd4299e408aa785740dc305a7ad10b205.tar.gz chromium_src-b163563dd4299e408aa785740dc305a7ad10b205.tar.bz2 |
After I watch running test carefully, I found that history page option starts coming into the omnibox, but test count comparison wasn't catching that. So now checking history page option in each waituntil iteration.
Review URL: http://codereview.chromium.org/6008012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70758 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/functional/omnibox.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/test/functional/omnibox.py b/chrome/test/functional/omnibox.py index 31912e0..0bdb00c 100644 --- a/chrome/test/functional/omnibox.py +++ b/chrome/test/functional/omnibox.py @@ -307,6 +307,14 @@ class OmniboxTest(pyauto.PyUITest): matches_description = [x for x in matches if x['destination_url'] == url] self.assertEqual(1, len(matches_description)) + def _GotHistoryPageOption(self, search_text): + """Determines if omnibox returns an 'open history page' option for given + search text""" + matches = self._GetOmniboxMatchesFor(search_text) + matches_description = [x for x in matches if x['type'] == + 'open-history-page'] + return len(matches_description) != 0 + def testRecentPageHistory(self): """Verify that omnibox shows recent history option in the visited url list.""" @@ -314,18 +322,13 @@ class OmniboxTest(pyauto.PyUITest): 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 120 seconds, since expected page only shows up # after > 60 seconds on some machines 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), + lambda: self._GotHistoryPageOption(search_text), timeout=120)) - matches = self._GetOmniboxMatchesFor(search_text) - matches_description = [x for x in matches if x['type'] == - 'open-history-page'] - self.assertEqual(1, len(matches_description)) def _VerifyHasBookmarkResult(self, matches): """Verify that we have a bookmark result.""" |