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

Issue 9595032: Track what PDFs fail to load (Closed)

Created:
8 years, 9 months ago by krisr
Modified:
8 years, 9 months ago
Reviewers:
Nirnimesh
CC:
chromium-reviews, dennis_jeffrey, John Grabowski, anantha, dyu1, Nirnimesh
Visibility:
Public.

Description

Track what PDFs fail to load TEST=Ran it BUG=chromium-os:25775 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=125007

Patch Set 1 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -4 lines) Patch
M chrome/test/functional/pdf.py View 5 chunks +16 lines, -4 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
krisr
8 years, 9 months ago (2012-03-05 20:02:25 UTC) #1
Nirnimesh
8 years, 9 months ago (2012-03-05 21:52:28 UTC) #2
Lgtm

On Monday, March 5, 2012,  <krisr@chromium.org> wrote:
> Reviewers: Nirnimesh,
>
> Description:
> Track what PDFs fail to load
>
> TEST=Ran it
> BUG=chromium-os:25775
>
> Please review this at https://chromiumcodereview.appspot.com/9595032/
>
> SVN Base: svn://chrome-svn/chrome/trunk/src/
>
> Affected files:
>  M     chrome/test/functional/pdf.py
>
>
> Index: chrome/test/functional/pdf.py
> ===================================================================
> --- chrome/test/functional/pdf.py       (revision 124969)
> +++ chrome/test/functional/pdf.py       (working copy)
> @@ -8,6 +8,7 @@
>
>  import pyauto_functional  # Must be imported before pyauto
>  import pyauto
> +from pyauto_errors import JSONInterfaceError
>
>
>  class PDFTest(pyauto.PyUITest):
> @@ -16,6 +17,8 @@
>   This test runs only on Google Chrome build, not on Chromium.
>   """
>
> +  unloadable_pdfs = []
> +
>   def _PerformPDFAction(self, action, tab_index=0, windex=0):
>     """Perform an action on a PDF tab.
>
> @@ -30,10 +33,16 @@
>       document.getElementsByName("plugin")[0])
>       { window.domAutomationController.send("true"); }
>       else {window.domAutomationController.send("false"); }"""
> -    self.assertTrue(self.WaitUntil(lambda: self.ExecuteJavascript(js,
> -      tab_index=tab_index, windex=windex), expect_retval="true"),
> -      msg='Could not find zoom/fit to page/width bar so we will not be
able '
> -          'to peform the requested action')
> +    try:
> +      self.assertTrue(self.WaitUntil(lambda: self.ExecuteJavascript(js,
> +        tab_index=tab_index, windex=windex), expect_retval="true"),
> +        msg='Could not find zoom/fit to page/width bar so we will not be
able '
> +            'to peform the requested action')
> +    except JSONInterfaceError as e:
> +      # The PDF did not load, add it to the list and move on, we don't
want the
> +      # test to abort so we can check all of the PDFs.
> +      PDFTest.unloadable_pdfs.append(self.GetActiveTabTitle())
> +      return
>     assert action in ('fitToHeight', 'fitToWidth', 'ZoomIn', 'ZoomOut')
>     js = 'document.getElementsByName("plugin")[0].%s()' % action
>     # Add an empty string so that there's something to return back
> @@ -61,6 +70,7 @@
>     pdf_files = [x for x in pdf_files if
>                  os.path.basename(x) not in exclude_list]
>
> +    PDFTest.unloadable_pdfs = []
>     for url in pdf_files:
>       self.AppendTab(pyauto.GURL(url))
>     for tab_index in range(1, len(pdf_files) + 1):
> @@ -74,6 +84,8 @@
>     for dmp_file in glob.glob(os.path.join(breakpad_folder, '*.dmp')):
>       self.assertTrue(dmp_file in old_dmp_files,
>           msg='Crash dump %s found' % dmp_file)
> +    self.assertEqual(len(PDFTest.unloadable_pdfs), 0, msg='The following
PDFs '
> +                     'did not load: %s' % PDFTest.unloadable_pdfs)
>
>
>  if __name__ == '__main__':
>
>
>

-- 
../NiR

Powered by Google App Engine
This is Rietveld 408576698