OLD | NEW |
---|---|
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 Loading... | |
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 pdf file 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') |
Nirnimesh
2011/01/22 02:10:09
update this comment as well
| |
248 # Search in pdf file 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') | |
Nirnimesh
2011/01/22 02:10:09
and this
| |
247 | 252 |
248 | 253 |
249 if __name__ == '__main__': | 254 if __name__ == '__main__': |
250 pyauto_functional.Main() | 255 pyauto_functional.Main() |
OLD | NEW |