Chromium Code Reviews| Index: functional/omnibox.py |
| =================================================================== |
| --- functional/omnibox.py (revision 70574) |
| +++ functional/omnibox.py (working copy) |
| @@ -307,6 +307,16 @@ |
| matches_description = [x for x in matches if x['destination_url'] == url] |
| self.assertEqual(1, len(matches_description)) |
| + def _verifyOpenHistoryPageOption(self, search_text): |
|
Nirnimesh
2011/01/06 02:09:17
This is a misnomer. Doens't really 'verify'
Renam
|
| + """Verify if history page option is available or not in the omnnibox |
| + results""" |
| + matches = self._GetOmniboxMatchesFor(search_text) |
| + matches_description = [x for x in matches if x['type'] == |
| + 'open-history-page'] |
| + if len(matches_description) == 0: |
|
Nirnimesh
2011/01/06 02:09:17
return len(matches_description) != 0
|
| + return False |
| + return True |
| + |
| def testRecentPageHistory(self): |
| """Verify that omnibox shows recent history option in the visited |
| url list.""" |
| @@ -314,18 +324,13 @@ |
| 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._verifyOpenHistoryPageOption(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.""" |