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