Fix OOP <webview> resize and autosize.
[chromium-blink-merge.git] / tools / perf / measurements / skpicture_printer_unittest.py
blobd06bbc73d5b66357d4c3d32b5eb4e971e5341322
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import shutil
6 import tempfile
8 from telemetry import decorators
9 from telemetry.testing import options_for_unittests
10 from telemetry.testing import page_test_test_case
12 from measurements import skpicture_printer
15 class SkpicturePrinterUnitTest(page_test_test_case.PageTestTestCase):
16 def setUp(self):
17 self._options = options_for_unittests.GetCopy()
18 self._skp_outdir = tempfile.mkdtemp('_skp_test')
20 def tearDown(self):
21 shutil.rmtree(self._skp_outdir)
23 @decorators.Disabled('android')
24 def testSkpicturePrinter(self):
25 ps = self.CreateStorySetFromFileInUnittestDataDir('blank.html')
26 measurement = skpicture_printer.SkpicturePrinter(self._skp_outdir)
27 results = self.RunMeasurement(measurement, ps, options=self._options)
29 # Picture printing is not supported on all platforms.
30 if results.failures:
31 assert 'not supported' in results.failures[0].exc_info[1].message
32 return
34 saved_picture_count = results.FindAllPageSpecificValuesNamed(
35 'saved_picture_count')
36 self.assertEquals(len(saved_picture_count), 1)
37 self.assertGreater(saved_picture_count[0].GetRepresentativeNumber(), 0)