summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib
diff options
context:
space:
mode:
authorvclarke@chromium.org <vclarke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-15 03:21:22 +0000
committervclarke@chromium.org <vclarke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-15 03:21:22 +0000
commit745be9dc8fb77962467f39485984f349aa99ba58 (patch)
tree7064555eb888d8593e424d4904b1bf8f5707616f /chrome/test/pyautolib
parentc83c92cf8c49dac3183d341076b592c702070468 (diff)
downloadchromium_src-745be9dc8fb77962467f39485984f349aa99ba58.zip
chromium_src-745be9dc8fb77962467f39485984f349aa99ba58.tar.gz
chromium_src-745be9dc8fb77962467f39485984f349aa99ba58.tar.bz2
Fix flakiness and re-enable http search in find_in_page.FindMatchTests.testSearchInPDF
Add loop to _VerifySearchInPDFURL to try FindInPage 10 times and re-raise the exception on the final loop. This is required because _GetResultFromJSONRequest appears to timeout if called before the PDF has loaded. Add timeout parameter to pyauto.FindInPage to be passed to _GetResultFromJSONRequest to speed up the loop in _VerifySearchInPDFURL from the default of 45 seconds to 1 second. Re-enable test on Mac. BUG=107448, 70927, 93956 Review URL: http://codereview.chromium.org/8913012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rwxr-xr-xchrome/test/pyautolib/pyauto.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index 8523e16..4ee0d5b 100755
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -2663,7 +2663,7 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
def FindInPage(self, search_string, forward=True,
match_case=False, find_next=False,
- tab_index=0, windex=0):
+ tab_index=0, windex=0, timeout=-1):
"""Find the match count for the given search string and search parameters.
This is equivalent to using the find box.
@@ -2673,7 +2673,8 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
match_case: Boolean to set for case sensitive search.
find_next: Boolean to set to continue the search or start from beginning.
tab_index: The tab index, default is 0.
- window_index: The window index, default is 0.
+ windex: The window index, default is 0.
+ timeout: request timeout (in milliseconds), default is -1.
Returns:
number of matches found for the given search string and parameters
@@ -2695,7 +2696,8 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
'match_case' : match_case,
'find_next' : find_next,
}
- return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
+ return self._GetResultFromJSONRequest(cmd_dict, windex=windex,
+ timeout=timeout)
def ExecuteJavascript(self, js, tab_index=0, windex=0, frame_xpath=''):
"""Executes a script in the specified frame of a tab.