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

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
Index: functional/find_in_page.py
===================================================================
--- functional/find_in_page.py (revision 113876)
+++ 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.
kkania 2011/12/15 00:41:36 Add an explanation about the bug and a reference t
vclarke1 2011/12/15 00:52:09 Done.
+ 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)
@@ -231,10 +241,9 @@
file_url = self.GetFileURLForDataPath('plugin', 'Embed.pdf')
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') | pyautolib/pyauto.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698