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

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

Issue 1058013005: [Telemetry] Switch BeginGestureInteraction to CreateGestureInteraction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/top_25_smooth.py ('k') | tools/perf/page_sets/tough_pinch_zoom_cases.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/top_7_stress.py
diff --git a/tools/perf/page_sets/top_7_stress.py b/tools/perf/page_sets/top_7_stress.py
index 5547358b819ed5eac382012adf9dfc604a4dde1a..79da3bed84a186ba6557e78b3d8a267f7f69512c 100644
--- a/tools/perf/page_sets/top_7_stress.py
+++ b/tools/perf/page_sets/top_7_stress.py
@@ -41,58 +41,44 @@ class GoogleWebSearchPage(Top7StressPage):
action_runner.WaitForElement(text='Next')
def RunPageInteractions(self, action_runner):
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
old_href = _GetCurrentLocation(action_runner)
action_runner.ClickElement(text='Next')
_WaitForLocationChange(action_runner, old_href)
action_runner.WaitForElement(text='Next')
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
old_href = _GetCurrentLocation(action_runner)
action_runner.ClickElement(text='Next')
_WaitForLocationChange(action_runner, old_href)
action_runner.WaitForElement(text='Next')
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
old_href = _GetCurrentLocation(action_runner)
action_runner.ClickElement(text='Next')
_WaitForLocationChange(action_runner, old_href)
action_runner.WaitForElement(text='Previous')
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
old_href = _GetCurrentLocation(action_runner)
action_runner.ClickElement(text='Previous')
_WaitForLocationChange(action_runner, old_href)
action_runner.WaitForElement(text='Previous')
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
old_href = _GetCurrentLocation(action_runner)
action_runner.ClickElement(text='Previous')
_WaitForLocationChange(action_runner, old_href)
action_runner.WaitForElement(text='Previous')
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
old_href = _GetCurrentLocation(action_runner)
action_runner.ClickElement(text='Previous')
_WaitForLocationChange(action_runner, old_href)
action_runner.WaitForElement(text='Images')
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
old_href = _GetCurrentLocation(action_runner)
action_runner.ClickElement(text='Images')
_WaitForLocationChange(action_runner, old_href)
@@ -229,26 +215,20 @@ class BlogspotPage(Top7StressPage):
def RunPageInteractions(self, action_runner):
action_runner.ClickElement(text='accessibility')
action_runner.WaitForNavigate()
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
# Insert 300ms wait to simulate user finger movement,
# and ensure scheduling of idle tasks.
action_runner.Wait(0.3)
action_runner.ClickElement(text='advanced')
action_runner.WaitForNavigate()
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
action_runner.Wait(0.3)
action_runner.ClickElement(text='beginner')
action_runner.WaitForNavigate()
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
action_runner.Wait(0.3)
action_runner.ClickElement(text='Home')
action_runner.WaitForNavigate()
@@ -272,10 +252,8 @@ class WordpressPage(Top7StressPage):
'a[href="http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-sight/"]')
def RunPageInteractions(self, action_runner):
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
# Insert 300ms wait to simulate user finger movement,
# and ensure scheduling of idle tasks.
action_runner.Wait(0.3)
@@ -283,24 +261,18 @@ class WordpressPage(Top7StressPage):
# pylint: disable=C0301
'a[href="http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-sight/"]')
action_runner.WaitForNavigate()
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
action_runner.Wait(0.3)
action_runner.ClickElement(text='Features')
action_runner.WaitForNavigate()
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
action_runner.Wait(0.3)
action_runner.ClickElement(text='News')
action_runner.WaitForNavigate()
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
class FacebookPage(Top7StressPage):
@@ -320,19 +292,15 @@ class FacebookPage(Top7StressPage):
def RunPageInteractions(self, action_runner):
# Scroll and wait for the next page to be loaded.
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
action_runner.WaitForJavaScriptCondition(
'document.documentElement.scrollHeight - window.innerHeight - '
'window.pageYOffset > 0')
# Scroll and wait again.
- interaction = action_runner.BeginGestureInteraction(
- 'ScrollAction')
- action_runner.ScrollPage()
- interaction.End()
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
action_runner.WaitForJavaScriptCondition(
'document.documentElement.scrollHeight - window.innerHeight - '
'window.pageYOffset > 0')
« no previous file with comments | « tools/perf/page_sets/top_25_smooth.py ('k') | tools/perf/page_sets/tough_pinch_zoom_cases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698