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

Unified Diff: functional/pdf.py

Issue 4967003: PDF Runner test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 10 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: functional/pdf.py
===================================================================
--- functional/pdf.py (revision 0)
+++ functional/pdf.py (revision 0)
@@ -0,0 +1,35 @@
+#!/usr/bin/python
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import glob
+
+import pyauto_functional # Must be imported before pyauto
+import pyauto
+
+
+class PDFsTest(pyauto.PyUITest):
+ """PDF related tests
+
+ This test runs only on Google Chrome build, not on Chromium.
+ """
+
+ def testPDFRunner(self):
+ """Navigate to pdf files and verify that browser doesn't crash"""
+ # bail out if not a branded build
+ properties = self.GetBrowserInfo()['properties']
+ if properties['branding'] != 'Google Chrome':
+ return
+ pdf_files_path = os.path.join(self.DataDir(), 'pyauto_private', 'pdf')
+ pdf_files = glob.glob(os.path.join(pdf_files_path, '*.pdf'))
+ for pdf_file in pdf_files:
+ url = self.GetFileURLForPath(os.path.join(pdf_files_path, pdf_file))
+ self.AppendTab(pyauto.GURL(url))
+ # Assert that there is at least 1 browser window.
+ self.assertTrue(self.GetBrowserWindowCount(),
+ 'Browser crashed, no window is open')
+
+if __name__ == '__main__':
+ pyauto_functional.Main()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698