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

Unified Diff: tools/perf/measurements/screenshot_unittest.py

Issue 271733008: telemetry: add screenshot measurement (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle browsers/platforms that don't support screenshotting. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/measurements/screenshot.py ('k') | tools/telemetry/telemetry/page/page_measurement.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/screenshot_unittest.py
diff --git a/tools/perf/measurements/skpicture_printer_unittest.py b/tools/perf/measurements/screenshot_unittest.py
similarity index 59%
copy from tools/perf/measurements/skpicture_printer_unittest.py
copy to tools/perf/measurements/screenshot_unittest.py
index cc762b81999cdb966de115ca5babec380ce473c6..db0c04268a4f434ec5504aec50c9f7f40a2c7ea2 100644
--- a/tools/perf/measurements/skpicture_printer_unittest.py
+++ b/tools/perf/measurements/screenshot_unittest.py
@@ -2,33 +2,32 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import logging
import shutil
import tempfile
-from measurements import skpicture_printer
-from telemetry import test
+from measurements import screenshot
from telemetry.page import page_measurement_unittest_base
+from telemetry.page import page_test
from telemetry.unittest import options_for_unittests
-class SkpicturePrinterUnitTest(
+class ScreenshotUnitTest(
page_measurement_unittest_base.PageMeasurementUnitTestBase):
def setUp(self):
self._options = options_for_unittests.GetCopy()
- self._options.skp_outdir = tempfile.mkdtemp('_skp_test')
+ self._options.png_outdir = tempfile.mkdtemp('_png_test')
def tearDown(self):
- shutil.rmtree(self._options.skp_outdir)
+ shutil.rmtree(self._options.png_outdir)
- @test.Disabled('android')
- def testSkpicturePrinter(self):
+ def testScreenshot(self):
ps = self.CreatePageSetFromFileInUnittestDataDir('blank.html')
- measurement = skpicture_printer.SkpicturePrinter()
- results = self.RunMeasurement(measurement, ps, options=self._options)
-
- # Picture printing is not supported on all platforms.
- if results.failures:
- assert 'not supported' in results.failures[0][1]
+ measurement = screenshot.Screenshot()
+ try:
+ results = self.RunMeasurement(measurement, ps, options=self._options)
+ except page_test.TestNotSupportedOnPlatformFailure as failure:
+ logging.warning(str(failure))
return
saved_picture_count = results.FindAllPageSpecificValuesNamed(
« no previous file with comments | « tools/perf/measurements/screenshot.py ('k') | tools/telemetry/telemetry/page/page_measurement.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698