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

Issue 2559503002: [Telemetry] Fix JavaScript interpolation in telemetry actions (Closed)

Created:
4 years ago by perezju
Modified:
4 years ago
Reviewers:
nednguyen
CC:
catapult-reviews_chromium.org, telemetry-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
catapult
Visibility:
Public.

Description

[Telemetry] Fix JavaScript interpolation in telemetry actions Telemetry actions expose API's for clients to interact with elements on a page (e.g. scroll or tap). Some of these take parameters (e.g. a CSS selector) which were naively interpolated into JavaScript snippets, but this is brittle when special characters are involved. In this CL we migrate all of these to use the js_template helper, which takes care of safely inserting Python values into the JavaScript snippets. BUG=catapult:#3028 Review-Url: https://codereview.chromium.org/2559503002 Committed: https://chromium.googlesource.com/external/github.com/catapult-project/catapult/+/c78686903901261433d5abf72d94f0052524b5c7

Patch Set 1 #

Total comments: 2

Patch Set 2 : nit #

Total comments: 10

Patch Set 3 : rebase on master #

Patch Set 4 : inline js literals #

Unified diffs Side-by-side diffs Delta from patch set Stats (+183 lines, -159 lines) Patch
M telemetry/telemetry/internal/actions/drag.py View 1 2 3 3 chunks +18 lines, -18 lines 0 comments Download
M telemetry/telemetry/internal/actions/load_media.py View 2 chunks +6 lines, -3 lines 0 comments Download
M telemetry/telemetry/internal/actions/load_media_unittest.py View 2 chunks +6 lines, -3 lines 0 comments Download
M telemetry/telemetry/internal/actions/loop.py View 2 chunks +6 lines, -3 lines 0 comments Download
M telemetry/telemetry/internal/actions/media_action.py View 2 chunks +6 lines, -3 lines 0 comments Download
M telemetry/telemetry/internal/actions/mouse_click.py View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M telemetry/telemetry/internal/actions/page_action.py View 5 chunks +26 lines, -24 lines 0 comments Download
M telemetry/telemetry/internal/actions/pinch.py View 1 2 3 3 chunks +14 lines, -14 lines 0 comments Download
M telemetry/telemetry/internal/actions/play.py View 2 chunks +5 lines, -2 lines 0 comments Download
M telemetry/telemetry/internal/actions/scroll.py View 4 chunks +23 lines, -20 lines 0 comments Download
M telemetry/telemetry/internal/actions/scroll_bounce.py View 2 chunks +19 lines, -20 lines 0 comments Download
M telemetry/telemetry/internal/actions/scroll_to_element.py View 3 chunks +7 lines, -6 lines 0 comments Download
M telemetry/telemetry/internal/actions/seek.py View 2 chunks +10 lines, -3 lines 0 comments Download
M telemetry/telemetry/internal/actions/swipe.py View 1 2 3 2 chunks +16 lines, -16 lines 0 comments Download
M telemetry/telemetry/internal/actions/tap.py View 1 2 3 3 chunks +17 lines, -20 lines 0 comments Download

Messages

Total messages: 13 (7 generated)
perezju
https://codereview.chromium.org/2559503002/diff/1/telemetry/telemetry/internal/actions/drag.py File telemetry/telemetry/internal/actions/drag.py (right): https://codereview.chromium.org/2559503002/diff/1/telemetry/telemetry/internal/actions/drag.py#newcode70 telemetry/telemetry/internal/actions/drag.py:70: callback='function() { window.__dragActionDone = true; }') This idiom is ...
4 years ago (2016-12-06 16:26:41 UTC) #4
perezju
ping
4 years ago (2016-12-09 11:43:23 UTC) #5
nednguyen
lgtm with nits https://codereview.chromium.org/2559503002/diff/20001/telemetry/telemetry/internal/actions/drag.py File telemetry/telemetry/internal/actions/drag.py (right): https://codereview.chromium.org/2559503002/diff/20001/telemetry/telemetry/internal/actions/drag.py#newcode69 telemetry/telemetry/internal/actions/drag.py:69: window.__dragAction = new __DragAction({{ @callback }});''', ...
4 years ago (2016-12-09 12:29:08 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2559503002/60001
4 years ago (2016-12-14 12:18:14 UTC) #9
perezju
https://codereview.chromium.org/2559503002/diff/20001/telemetry/telemetry/internal/actions/drag.py File telemetry/telemetry/internal/actions/drag.py (right): https://codereview.chromium.org/2559503002/diff/20001/telemetry/telemetry/internal/actions/drag.py#newcode69 telemetry/telemetry/internal/actions/drag.py:69: window.__dragAction = new __DragAction({{ @callback }});''', On 2016/12/09 12:29:07, ...
4 years ago (2016-12-14 12:18:21 UTC) #10
commit-bot: I haz the power
4 years ago (2016-12-14 12:48:47 UTC) #13
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/external/github.com/catapult-project/catapu...

Powered by Google App Engine
This is Rietveld 408576698