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

Side by Side Diff: tools/perf/measurements/media.py

Issue 2855333002: telemetry: support old builds that still use disable-gesture-requirement-for-media-playback flag. (Closed)
Patch Set: More detailed comments. Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « tools/perf/benchmarks/media.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from telemetry.page import legacy_page_test 5 from telemetry.page import legacy_page_test
6 6
7 from metrics import cpu 7 from metrics import cpu
8 from metrics import media 8 from metrics import media
9 from metrics import power 9 from metrics import power
10 from metrics import system_memory 10 from metrics import system_memory
(...skipping 13 matching lines...) Expand all
24 self._add_browser_metrics = False 24 self._add_browser_metrics = False
25 self._cpu_metric = None 25 self._cpu_metric = None
26 self._memory_metric = None 26 self._memory_metric = None
27 self._power_metric = None 27 self._power_metric = None
28 28
29 def WillStartBrowser(self, platform): 29 def WillStartBrowser(self, platform):
30 self._power_metric = power.PowerMetric(platform) 30 self._power_metric = power.PowerMetric(platform)
31 31
32 def CustomizeBrowserOptions(self, options): 32 def CustomizeBrowserOptions(self, options):
33 # Needed to run media actions in JS on touch-based devices as on Android. 33 # Needed to run media actions in JS on touch-based devices as on Android.
34 options.AppendExtraBrowserArgs('--ignore-autoplay-restrictions') 34 # Note that both of these flags should be used until every build from
35 # ToT to Stable switches over to one flag or another. This is to support
36 # reference builds.
37 # --disable-gesture-requirement-for-media-playback is the old one and can be
38 # removed after M60 goes to stable.
39 options.AppendExtraBrowserArgs(
40 ['--ignore-autoplay-restrictions',
41 '--disable-gesture-requirement-for-media-playback'])
35 power.PowerMetric.CustomizeBrowserOptions(options) 42 power.PowerMetric.CustomizeBrowserOptions(options)
36 43
37 def DidNavigateToPage(self, page, tab): 44 def DidNavigateToPage(self, page, tab):
38 """Override to do operations right after the page is navigated.""" 45 """Override to do operations right after the page is navigated."""
39 self._media_metric = media.MediaMetric(tab) 46 self._media_metric = media.MediaMetric(tab)
40 self._media_metric.Start(page, tab) 47 self._media_metric.Start(page, tab)
41 48
42 # Reset to false for every page. 49 # Reset to false for every page.
43 self._add_browser_metrics = ( 50 self._add_browser_metrics = (
44 page.add_browser_metrics 51 page.add_browser_metrics
(...skipping 19 matching lines...) Expand all
64 exclude_metrics = ['WorkingSetSizePeak', 'SystemCommitCharge', 'VMPeak', 71 exclude_metrics = ['WorkingSetSizePeak', 'SystemCommitCharge', 'VMPeak',
65 'VM'] 72 'VM']
66 self._memory_metric.AddResults(tab, results, 73 self._memory_metric.AddResults(tab, results,
67 trace_name=trace_name, 74 trace_name=trace_name,
68 exclude_metrics=exclude_metrics) 75 exclude_metrics=exclude_metrics)
69 self._power_metric.AddResults(tab, results) 76 self._power_metric.AddResults(tab, results)
70 77
71 def DidRunPage(self, platform): 78 def DidRunPage(self, platform):
72 del platform # unused 79 del platform # unused
73 self._power_metric.Close() 80 self._power_metric.Close()
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/media.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698