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

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

Issue 149793002: Enable media android tests and make --disable-gesture-requirement-for-media-playback default for me… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 10 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 metrics import cpu 5 from metrics import cpu
6 from metrics import media 6 from metrics import media
7 from metrics import memory 7 from metrics import memory
8 from metrics import power 8 from metrics import power
9 from telemetry.page import page_measurement 9 from telemetry.page import page_measurement
10 10
(...skipping 12 matching lines...) Expand all
23 self._add_browser_metrics = False 23 self._add_browser_metrics = False
24 self._cpu_metric = None 24 self._cpu_metric = None
25 self._memory_metric = None 25 self._memory_metric = None
26 self._power_metric = power.PowerMetric() 26 self._power_metric = power.PowerMetric()
27 27
28 def results_are_the_same_on_every_page(self): 28 def results_are_the_same_on_every_page(self):
29 """Results can vary from page to page based on media events taking place.""" 29 """Results can vary from page to page based on media events taking place."""
30 return False 30 return False
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.
34 options.AppendExtraBrowserArgs(
35 '--disable-gesture-requirement-for-media-playback')
33 memory.MemoryMetric.CustomizeBrowserOptions(options) 36 memory.MemoryMetric.CustomizeBrowserOptions(options)
34 power.PowerMetric.CustomizeBrowserOptions(options) 37 power.PowerMetric.CustomizeBrowserOptions(options)
35 38
36 def DidNavigateToPage(self, page, tab): 39 def DidNavigateToPage(self, page, tab):
37 """Override to do operations right after the page is navigated.""" 40 """Override to do operations right after the page is navigated."""
38 self._media_metric = media.MediaMetric(tab) 41 self._media_metric = media.MediaMetric(tab)
39 self._media_metric.Start(page, tab) 42 self._media_metric.Start(page, tab)
40 self._power_metric.Start(page, tab) 43 self._power_metric.Start(page, tab)
41 44
42 # Reset to false for every page. 45 # Reset to false for every page.
(...skipping 12 matching lines...) Expand all
55 """Measure the page's performance.""" 58 """Measure the page's performance."""
56 self._power_metric.Stop(page, tab) 59 self._power_metric.Stop(page, tab)
57 self._media_metric.Stop(page, tab) 60 self._media_metric.Stop(page, tab)
58 trace_name = self._media_metric.AddResults(tab, results) 61 trace_name = self._media_metric.AddResults(tab, results)
59 self._power_metric.AddResults(tab, results) 62 self._power_metric.AddResults(tab, results)
60 if self._add_browser_metrics: 63 if self._add_browser_metrics:
61 self._cpu_metric.Stop(page, tab) 64 self._cpu_metric.Stop(page, tab)
62 self._cpu_metric.AddResults(tab, results, trace_name=trace_name) 65 self._cpu_metric.AddResults(tab, results, trace_name=trace_name)
63 self._memory_metric.Stop(page, tab) 66 self._memory_metric.Stop(page, tab)
64 self._memory_metric.AddResults(tab, results, trace_name=trace_name) 67 self._memory_metric.AddResults(tab, results, trace_name=trace_name)
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