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

Side by Side Diff: functional/find_in_page.py

Issue 6297014: Adding web pdf files to the tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: Created 9 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | functional/pdf.py » ('j') | functional/pdf.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import codecs 6 import codecs
7 import os 7 import os
8 import unittest 8 import unittest
9 9
10 import pyauto_functional 10 import pyauto_functional
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 def testSearchInPDF(self): 233 def testSearchInPDF(self):
234 """Verify that we can find in a pdf file. 234 """Verify that we can find in a pdf file.
235 235
236 Only for Google Chrome builds (Chromium builds do not have internal pdf). 236 Only for Google Chrome builds (Chromium builds do not have internal pdf).
237 """ 237 """
238 # bail out if not a branded build 238 # bail out if not a branded build
239 properties = self.GetBrowserInfo()['properties'] 239 properties = self.GetBrowserInfo()['properties']
240 if properties['branding'] != 'Google Chrome': 240 if properties['branding'] != 'Google Chrome':
241 return 241 return
242 # Search in the disk pdf file
Nirnimesh 2011/01/22 01:42:26 Search in pdf over file://
242 url = self.GetFileURLForPath(os.path.join( 243 url = self.GetFileURLForPath(os.path.join(
243 self.DataDir(), 'plugin', 'Embed.pdf')) 244 self.DataDir(), 'plugin', 'Embed.pdf'))
244 self.NavigateToURL(url) 245 self.NavigateToURL(url)
245 search_count = self.FindInPage('adobe')['match_count'] 246 search_count = self.FindInPage('adobe')['match_count']
246 self.assertEqual(8, search_count, 'Failed to find in the pdf file') 247 self.assertEqual(8, search_count, 'Failed to find in the disk pdf file')
248 # Search in the web pdf file
Nirnimesh 2011/01/22 01:42:26 Search in pdf over http://
249 self.NavigateToURL('http://www.irs.gov/pub/irs-pdf/fw4.pdf')
250 search_count = self.FindInPage('Allowances')['match_count']
251 self.assertEqual(16, search_count, 'Failed to find in the web pdf file')
247 252
248 253
249 if __name__ == '__main__': 254 if __name__ == '__main__':
250 pyauto_functional.Main() 255 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « no previous file | functional/pdf.py » ('j') | functional/pdf.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698