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

Unified Diff: tools/perf/page_sets/google_pages.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/blob_workshop.py ('k') | tools/perf/page_sets/indexeddb_endure_page.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/google_pages.py
diff --git a/tools/perf/page_sets/google_pages.py b/tools/perf/page_sets/google_pages.py
index d782a475f3c6b29a14d533097763682749fa18dd..abdb76a6cd71f073a55187f7388c2d44bc3fdcdd 100644
--- a/tools/perf/page_sets/google_pages.py
+++ b/tools/perf/page_sets/google_pages.py
@@ -6,6 +6,7 @@ from page_sets.login_helpers import google_login
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
+from telemetry.util import js_template
import os
@@ -67,8 +68,8 @@ class AdwordCampaignDesktopPage(page_module.Page):
page_set=page_set, name='AdwordsCampaign',
credentials_path='data/credentials.json',
shared_page_state_class=shared_page_state.SharedDesktopPageState)
- 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 RunNavigateSteps(self, action_runner):
google_login.LoginGoogleAccount(action_runner, 'google3',
@@ -77,5 +78,5 @@ class AdwordCampaignDesktopPage(page_module.Page):
def RunPageInteractions(self, action_runner):
action_runner.WaitForElement(text='Welcome to AdWords!')
- # 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)
« no previous file with comments | « tools/perf/page_sets/blob_workshop.py ('k') | tools/perf/page_sets/indexeddb_endure_page.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698