Change next_proto member type.
[chromium-blink-merge.git] / tools / perf / measurements / skpicture_printer_unittest.py
blobffa1864384c1cf9d88b5c3471d70a3a4b05c033c
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 measurements import skpicture_printer
9 from telemetry.unittest_util import options_for_unittests
10 from telemetry.unittest_util import page_test_test_case
11 from telemetry.unittest_util import test
14 class SkpicturePrinterUnitTest(page_test_test_case.PageTestTestCase):
15 def setUp(self):
16 self._options = options_for_unittests.GetCopy()
17 self._skp_outdir = tempfile.mkdtemp('_skp_test')
19 def tearDown(self):
20 shutil.rmtree(self._skp_outdir)
22 @test.Disabled('android')
23 def testSkpicturePrinter(self):
24 ps = self.CreatePageSetFromFileInUnittestDataDir('blank.html')
25 measurement = skpicture_printer.SkpicturePrinter(self._skp_outdir)
26 results = self.RunMeasurement(measurement, ps, options=self._options)
28 # Picture printing is not supported on all platforms.
29 if results.failures:
30 assert 'not supported' in results.failures[0].exc_info[1].message
31 return
33 saved_picture_count = results.FindAllPageSpecificValuesNamed(
34 'saved_picture_count')
35 self.assertEquals(len(saved_picture_count), 1)
36 self.assertGreater(saved_picture_count[0].GetRepresentativeNumber(), 0)