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

Unified Diff: tools/perf/page_sets/system_health/media_stories.py

Issue 2618333006: [tools/perf] Fix JavaScript interpolation in action_runner calls (Closed)
Patch Set: Created 3 years, 11 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/page_sets/system_health/media_stories.py
diff --git a/tools/perf/page_sets/system_health/media_stories.py b/tools/perf/page_sets/system_health/media_stories.py
index 6a8501f92ba84dd18eb3eb8be153d992e39d2fe3..f195bf62f8c0951280dc8bda0ea7cbee4059bc16 100644
--- a/tools/perf/page_sets/system_health/media_stories.py
+++ b/tools/perf/page_sets/system_health/media_stories.py
@@ -46,10 +46,9 @@ class _MediaStory(system_health_story.SystemHealthStory):
self.PLAY_DURATION - self._GetTimeInSeconds(action_runner))
def _GetTimeInSeconds(self, action_runner):
- # TODO(catapult:#3028): Fix interpolation of JavaScript values.
- time_func = (
- 'document.querySelector("%s").textContent' % self.TIME_SELECTOR)
- minutes, seconds = action_runner.EvaluateJavaScript(time_func).split(':')
+ minutes, seconds = action_runner.EvaluateJavaScript(
+ 'document.querySelector({{ selector }}).textContent',
+ selector=self.TIME_SELECTOR).split(':')
return int(minutes * 60 + seconds)

Powered by Google App Engine
This is Rietveld 408576698