diff options
author | rohitbm@google.com <rohitbm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-15 00:24:59 +0000 |
---|---|---|
committer | rohitbm@google.com <rohitbm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-15 00:24:59 +0000 |
commit | 9f701fdbb0388152a3ce5ef01cc9b8fa43a5a315 (patch) | |
tree | 4e4cda3eb16adc02c4baf962dc23bb325c4cc763 | |
parent | aeb53f0e2f6352ec7fbc2113270a97072b42c764 (diff) | |
download | chromium_src-9f701fdbb0388152a3ce5ef01cc9b8fa43a5a315.zip chromium_src-9f701fdbb0388152a3ce5ef01cc9b8fa43a5a315.tar.gz chromium_src-9f701fdbb0388152a3ce5ef01cc9b8fa43a5a315.tar.bz2 |
Fixing omnibox page content search test
Review URL: http://codereview.chromium.org/6269001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71523 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/functional/omnibox.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/chrome/test/functional/omnibox.py b/chrome/test/functional/omnibox.py index cf89143..0ce09c1 100644 --- a/chrome/test/functional/omnibox.py +++ b/chrome/test/functional/omnibox.py @@ -278,15 +278,16 @@ class OmniboxTest(pyauto.PyUITest): partial_title = self._GetOmniboxMatchesFor(search_term, windex=windex) self._VerifyHasBookmarkResult(partial_title) - def _GotNewMatches(self, old_matches_len, search_text): - """Determines if omnibox has any new matches""" + def _GotContentHistory(self, search_text, url): + """Determines if omnibox returns a previously visited page for given + search text + """ # Omnibox doesn't change results if searching the same text repeatedly. # So setting '' in omnibox before the next repeated search. self.SetOmniboxText('') - new_matches = self._GetOmniboxMatchesFor(search_text) - if len(new_matches) > old_matches_len: - return True - return False + matches = self._GetOmniboxMatchesFor(search_text) + matches_description = [x for x in matches if x['destination_url'] == url] + return 1 == len(matches_description) def testContentHistory(self): """Verify omnibox results when entering page content @@ -294,16 +295,11 @@ class OmniboxTest(pyauto.PyUITest): Test verifies that visited page shows up in omnibox on entering page content. """ - search_text = 'British throne' - old_matches = self._GetOmniboxMatchesFor(search_text) url = self.GetFileURLForPath( os.path.join(self.DataDir(), 'find_in_page', 'largepage.html')) - self.AppendTab(pyauto.GURL(url)) - self.assertTrue(self.WaitUntil(lambda: self._GotNewMatches(len(old_matches), - search_text), timeout=1)) - matches = self._GetOmniboxMatchesFor(search_text) - matches_description = [x for x in matches if x['destination_url'] == url] - self.assertEqual(1, len(matches_description)) + self.NavigateToURL(url) + self.assertTrue(self.WaitUntil( + lambda: self._GotContentHistory('British throne', url))) def _GotHistoryPageOption(self, search_text): """Determines if omnibox returns an 'open history page' option for given |