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

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

Issue 2278653004: Add new multipage_skpicture_printer benchmark and measurement (Closed)
Patch Set: Remove unused imports Created 4 years, 4 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
Index: tools/perf/measurements/multipage_skpicture_printer.py
diff --git a/tools/perf/measurements/skpicture_printer.py b/tools/perf/measurements/multipage_skpicture_printer.py
similarity index 53%
copy from tools/perf/measurements/skpicture_printer.py
copy to tools/perf/measurements/multipage_skpicture_printer.py
index 499aa4893341dd336601255d84470a4cbb2b5859..30b7afc916d1ed38e25cb6606b935b7d70caec80 100644
--- a/tools/perf/measurements/skpicture_printer.py
+++ b/tools/perf/measurements/multipage_skpicture_printer.py
@@ -1,21 +1,19 @@
-# Copyright 2012 The Chromium Authors. All rights reserved.
+# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import glob
import os
from telemetry.page import legacy_page_test
-from telemetry.value import scalar
-_JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");'
+_JS = 'chrome.gpuBenchmarking.printPagesToSkPictures("{0}");'
-class SkpicturePrinter(legacy_page_test.LegacyPageTest):
+class MultipageSkpicturePrinter(legacy_page_test.LegacyPageTest):
- def __init__(self, skp_outdir):
- super(SkpicturePrinter, self).__init__()
- self._skp_outdir = skp_outdir
+ def __init__(self, mskp_outdir):
+ super(MultipageSkpicturePrinter, self).__init__()
+ self._mskp_outdir = mskp_outdir
def CustomizeBrowserOptions(self, options):
options.AppendExtraBrowserArgs(['--enable-gpu-benchmarking',
@@ -25,13 +23,10 @@ class SkpicturePrinter(legacy_page_test.LegacyPageTest):
def ValidateAndMeasurePage(self, page, tab, results):
if tab.browser.platform.GetOSName() in ['android', 'chromeos']:
raise legacy_page_test.MeasurementFailure(
- 'SkPicture printing not supported on this platform')
+ 'Multipage SkPicture printing not supported on this platform')
# Replace win32 path separator char '\' with '\\'.
outpath = os.path.abspath(
- os.path.join(self._skp_outdir, page.file_safe_name))
+ os.path.join(self._mskp_outdir, page.file_safe_name + '.mskp'))
js = _JS.format(outpath.replace('\\', '\\\\'))
tab.EvaluateJavaScript(js)
- pictures = glob.glob(os.path.join(outpath, '*.skp'))
- results.AddValue(scalar.ScalarValue(
- results.current_page, 'saved_picture_count', 'count', len(pictures)))
« no previous file with comments | « tools/perf/benchmarks/skpicture_printer.py ('k') | tools/perf/measurements/multipage_skpicture_printer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698