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

Unified Diff: tools/perf/page_sets/todomvc.py

Issue 2618333006: [tools/perf] Fix JavaScript interpolation in action_runner calls (Closed)
Patch Set: fix a few more interpolations 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
« no previous file with comments | « tools/perf/page_sets/system_health/media_stories.py ('k') | tools/perf/page_sets/top_7_stress.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/todomvc.py
diff --git a/tools/perf/page_sets/todomvc.py b/tools/perf/page_sets/todomvc.py
index 35daccbd6fc847b23504e1983260c776852690d3..43ce61e4f349dc61f50c4e3c173ac1f06ecec710 100644
--- a/tools/perf/page_sets/todomvc.py
+++ b/tools/perf/page_sets/todomvc.py
@@ -5,6 +5,7 @@
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
+from telemetry.util import js_template
URL_LIST = [
@@ -31,8 +32,8 @@ class TodoMVCPage(page_module.Page):
# TODO(jochen): This interaction does not include the
# WindowProxy::initialize portion before the commit. To fix this, we'll
# have to migrate to TBMv2.
- self.script_to_evaluate_on_commit = (
- 'console.time("%s");' % INTERACTION_NAME)
+ self.script_to_evaluate_on_commit = js_template.Render(
+ 'console.time({{ label }});', label=INTERACTION_NAME)
def RunPageInteractions(self, action_runner):
action_runner.ExecuteJavaScript(
@@ -48,8 +49,8 @@ class TodoMVCPage(page_module.Page):
"""
)
action_runner.WaitForJavaScriptCondition('this.becameIdle === true')
- # TODO(catapult:#3028): Fix interpolation of JavaScript values.
- action_runner.ExecuteJavaScript('console.timeEnd("%s");' % INTERACTION_NAME)
+ action_runner.ExecuteJavaScript(
+ 'console.timeEnd({{ label }});', label=INTERACTION_NAME)
class TodoMVCPageSet(story.StorySet):
« no previous file with comments | « tools/perf/page_sets/system_health/media_stories.py ('k') | tools/perf/page_sets/top_7_stress.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698