Index: functional/omnibox.py |
=================================================================== |
--- functional/omnibox.py (revision 71277) |
+++ functional/omnibox.py (working copy) |
@@ -278,15 +278,15 @@ |
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 visited page when searching using page |
Nirnimesh
2011/01/14 19:49:57
s/visited/previously visited/
Nirnimesh
2011/01/14 19:49:57
Simplify this sentence. I don't understand it.
|
+ content""" |
# 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 |
@@ -295,15 +295,11 @@ |
content. |
""" |
search_text = 'British throne' |
sunandt
2011/01/13 02:18:54
You don't need this variable. Pass this value dire
|
- old_matches = self._GetOmniboxMatchesFor(search_text) |
url = self.GetFileURLForPath( |
os.path.join(self.DataDir(), 'find_in_page', 'largepage.html')) |
self.AppendTab(pyauto.GURL(url)) |
sunandt
2011/01/13 02:18:54
Why are you opening a new tab?
|
- 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.assertTrue(self.WaitUntil( |
+ lambda: self._GotContentHistory(search_text, url))) |
def _GotHistoryPageOption(self, search_text): |
"""Determines if omnibox returns an 'open history page' option for given |