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.
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
):
16 self
._options
= options_for_unittests
.GetCopy()
17 self
._skp
_outdir
= tempfile
.mkdtemp('_skp_test')
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.
30 assert 'not supported' in results
.failures
[0].exc_info
[1].message
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)