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

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

Issue 337643002: Add SwipePage/SwipeElement API to action_runner, wrapping over (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Guard test execution so that test doesn't fail in browser that doesn't support touch. Created 6 years, 6 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/key_silk_cases.py ('k') | tools/telemetry/telemetry/page/actions/action_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/polymer.py
diff --git a/tools/perf/page_sets/polymer.py b/tools/perf/page_sets/polymer.py
index 2ce096aa1bb4292e50965e69cda99810a6c42e57..162aac07fabd40568551a2864d2df223f1595da8 100644
--- a/tools/perf/page_sets/polymer.py
+++ b/tools/perf/page_sets/polymer.py
@@ -51,32 +51,23 @@ class PolymerCalculatorPage(PolymerPage):
interaction.End()
def SlidePanel(self, action_runner):
- action_runner.RunAction(SwipeAction(
- {
- 'left_start_percentage': 0.1,
- 'distance': 300,
- 'direction': 'left',
- 'wait_after': {
- 'javascript': '''
- var outer = document.querySelector("body /deep/ #outerPanels");
- outer.opened || outer.wideMode;
- '''
- },
- 'top_start_percentage': 0.2,
- 'element_function': '''
- function(callback) {
- callback(
- document.querySelector(
- 'body /deep/ #outerPanels'
- ).querySelector(
- '#advanced'
- ).shadowRoot.querySelector(
- '.handle-bar'
- )
- );
- }''',
- 'speed': 5000
- }))
+ interaction = action_runner.BeginInteraction(
+ 'Action_SwipeAction', is_smooth=True)
+ action_runner.SwipeElement(
+ left_start_ratio=0.1, top_start_ratio=0.2,
+ direction='left', distance=300, speed=5000,
+ element_function='''
+ document.querySelector(
+ 'body /deep/ #outerPanels'
+ ).querySelector(
+ '#advanced'
+ ).shadowRoot.querySelector(
+ '.handle-bar'
+ )''')
+ action_runner.WaitForJavaScriptCondition('''
+ var outer = document.querySelector("body /deep/ #outerPanels");
+ outer.opened || outer.wideMode;''')
+ interaction.End()
class PolymerShadowPage(PolymerPage):
« no previous file with comments | « tools/perf/page_sets/key_silk_cases.py ('k') | tools/telemetry/telemetry/page/actions/action_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698