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

Unified Diff: tools/perf/page_sets/key_silk_cases.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 | « no previous file | tools/perf/page_sets/polymer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/key_silk_cases.py
diff --git a/tools/perf/page_sets/key_silk_cases.py b/tools/perf/page_sets/key_silk_cases.py
index 740a13a38703728e95c9422425f05c5545653450..2eb9fa30ec6b6edbd0e569ce1189441b4fe1b31a 100644
--- a/tools/perf/page_sets/key_silk_cases.py
+++ b/tools/perf/page_sets/key_silk_cases.py
@@ -283,18 +283,13 @@ class Page16(KeySilkCasesPage):
action_runner.Wait(2)
def SwipeToDismiss(self, action_runner):
- action_runner.RunAction(SwipeAction(
- {
- 'left_start_percentage': 0.8,
- 'distance': 200,
- 'direction': 'left',
- 'top_start_percentage': 0.2,
- 'element_function': '''
- function(callback) {
- callback(document.getElementsByClassName('message')[2]);
- }''',
- 'speed': 5000
- }))
+ interaction = action_runner.BeginGestureInteraction(
+ 'SwipeAction', is_smooth=True)
+ action_runner.SwipeElement(
+ left_start_ratio=0.8, top_start_ratio=0.2,
+ direction='left', distance=200, speed=5000,
+ element_function='document.getElementsByClassName("message")[2]')
+ interaction.End()
interaction = action_runner.BeginInteraction('Wait', is_smooth=True)
action_runner.WaitForJavaScriptCondition(
'document.getElementsByClassName("message").length < 18')
@@ -399,20 +394,15 @@ class Page19(KeySilkCasesPage):
self.SlideDrawer(action_runner)
def SlideDrawer(self, action_runner):
- action_runner.RunAction(SwipeAction(
- {
- 'left_start_percentage': 0.8,
- 'distance': 200,
- 'direction': 'left',
- 'top_start_percentage': 0.2,
- 'element_function': '''
- function(callback) {
- callback(document.getElementById('nav-drawer').children[0]);
- }''',
- 'wait_after' : {
- 'javascript': '!document.getElementById("nav-drawer").active'
- }
- }))
+ interaction = action_runner.BeginInteraction(
+ 'Action_SwipeAction', is_smooth=True)
+ action_runner.SwipeElement(
+ left_start_ratio=0.8, top_start_ratio=0.2,
+ direction='left', distance=200,
+ element_function='document.getElementById("nav-drawer").children[0]')
+ action_runner.WaitForJavaScriptCondition(
+ '!document.getElementById("nav-drawer").active')
+ interaction.End()
class Page20(KeySilkCasesPage):
@@ -566,15 +556,12 @@ class Page25(KeySilkCasesPage):
action_runner.Wait(1)
def RunSmoothness(self, action_runner):
- action_runner.RunAction(SwipeAction(
- {
- 'distance': 100,
- 'direction': "left",
- 'element_function': '''
- function(callback) {
- callback(document.getElementById(':f'));
- }'''
- }))
+ interaction = action_runner.BeginGestureInteraction(
+ 'SwipeAction', is_smooth=True)
+ action_runner.SwipeElement(
+ direction='left', distance=100,
+ element_function='document.getElementById(":f")')
+ interaction.End()
interaction = action_runner.BeginInteraction('Wait', is_smooth=True)
action_runner.Wait(1)
interaction.End()
« no previous file with comments | « no previous file | tools/perf/page_sets/polymer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698