diff options
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/functional/omnibox.py | 21 |
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'] |