Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1285)

Unified Diff: functional/find_in_page.py

Issue 8913012: Fix flakiness and re-enable http search in find_in_page.FindMatchTests.testSearchInPDF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « functional/PYAUTO_TESTS ('k') | pyautolib/pyauto.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: functional/find_in_page.py
===================================================================
--- functional/find_in_page.py (revision 114499)
+++ functional/find_in_page.py (working copy)
@@ -9,6 +9,7 @@
import pyauto_functional
import pyauto
+import pyauto_errors
import test_utils
@@ -214,7 +215,16 @@
def _VerifySearchInPDFURL(self, url, word, expected_count):
"""Verify that we can find in a pdf file."""
self.NavigateToURL(url)
- search_count = self.FindInPage(word)['match_count']
+ # Check for JSONInterfaceError thrown when FindInPage called before page
+ # loaded crbug.com/107448.
+ num_loops = 10
+ for loop in range(num_loops):
+ try:
+ search_count = self.FindInPage(word, timeout=1000)['match_count']
+ break
+ except pyauto_errors.JSONInterfaceError:
+ if loop == num_loops - 1:
+ raise
self.assertEqual(expected_count, search_count,
'Failed to find in the %s pdf file' % url)
@@ -229,12 +239,11 @@
return
# Search in pdf file over file://.
file_url = self.GetFileURLForDataPath('plugin', 'Embed.pdf')
- self._VerifySearchInPDFURL(file_url, 'adobe', 8)
+ self._VerifySearchInPDFURL(file_url, 'adobe', 8)
- # Disabling this test crbug.com/70927
# Search in pdf file over http://.
- # http_url = 'http://www.irs.gov/pub/irs-pdf/fw4.pdf'
- # self._VerifySearchInPDFURL(http_url, 'Allowances', 16)
+ http_url = 'http://www.irs.gov/pub/irs-pdf/fw4.pdf'
+ self._VerifySearchInPDFURL(http_url, 'Allowances', 16)
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « functional/PYAUTO_TESTS ('k') | pyautolib/pyauto.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698