Index: tools/perf/page_sets/tough_pinch_zoom_cases.py |
diff --git a/tools/perf/page_sets/tough_pinch_zoom_cases.py b/tools/perf/page_sets/tough_pinch_zoom_cases.py |
index a0067d154c78272351b81856389c105124ff296a..8da386d9c8170363b377d839a25674d56c82fdde 100644 |
--- a/tools/perf/page_sets/tough_pinch_zoom_cases.py |
+++ b/tools/perf/page_sets/tough_pinch_zoom_cases.py |
@@ -3,7 +3,7 @@ |
# found in the LICENSE file. |
from telemetry.page import page as page_module |
from telemetry.page import page_set as page_set_module |
- |
+import time |
class ToughPinchZoomCasesPage(page_module.Page): |
@@ -14,10 +14,28 @@ class ToughPinchZoomCasesPage(page_module.Page): |
self.user_agent_type = 'desktop' |
self.archive_data_file = 'data/tough_pinch_zoom_cases.json' |
+ def RunPinchGesture(self, action_runner, left_anchor_ratio=0.5, |
+ top_anchor_ratio=0.5, scale_factor=None, |
+ speed_in_pixels_per_second=800): |
+ #interaction = action_runner.BeginGestureInteraction( |
+ # 'PinchAction') |
+ |
+ action_runner.PinchPage( |
+ left_anchor_ratio=left_anchor_ratio, top_anchor_ratio=top_anchor_ratio, |
+ scale_factor=scale_factor, |
+ speed_in_pixels_per_second=speed_in_pixels_per_second) |
+ |
+ #interaction.End() |
+ |
def RunPageInteractions(self, action_runner): |
+ time.sleep(3) |
interaction = action_runner.BeginGestureInteraction( |
'PinchAction') |
- action_runner.PinchPage() |
+ for _ in range(0, 3): |
+ self.RunPinchGesture(action_runner, scale_factor=7.0) |
+ self.RunPinchGesture(action_runner, scale_factor=1/2.0) |
+ self.RunPinchGesture(action_runner, scale_factor=1/2.0) |
+ self.RunPinchGesture(action_runner, scale_factor=1/2.0) |
interaction.End() |
@@ -68,13 +86,6 @@ class GoogleCalendarPage(ToughPinchZoomCasesPage): |
super(GoogleCalendarPage, self).RunNavigateSteps(action_runner) |
action_runner.Wait(2) |
- def RunPageInteractions(self, action_runner): |
- interaction = action_runner.BeginGestureInteraction( |
- 'PinchAction') |
- action_runner.PinchPage(left_anchor_ratio=0.1, top_anchor_ratio=0.3) |
- interaction.End() |
- |
- |
class GoogleImageSearchPage(ToughPinchZoomCasesPage): |
""" Why: tough image case; top google properties """ |
@@ -105,10 +116,11 @@ class GooglePlusPage(ToughPinchZoomCasesPage): |
def RunPageInteractions(self, action_runner): |
interaction = action_runner.BeginGestureInteraction( |
'PinchAction') |
- action_runner.PinchElement(selector='[id="110031535020051778989-tab-bar"]') |
+ action_runner.PinchElement( |
+ scale_factor=9, speed_in_pixels_per_second=1600, |
+ selector='[id="110031535020051778989-tab-bar"]') |
interaction.End() |
- |
class YoutubePage(ToughPinchZoomCasesPage): |
""" Why: #3 (Alexa global) """ |
@@ -254,7 +266,7 @@ class ToughPinchZoomCasesPageSet(page_set_module.PageSet): |
self.AddUserStory(GmailPage(self)) |
self.AddUserStory(GoogleCalendarPage(self)) |
self.AddUserStory(GoogleImageSearchPage(self)) |
- self.AddUserStory(GooglePlusPage(self)) |
+ #self.AddUserStory(GooglePlusPage(self)) |
self.AddUserStory(YoutubePage(self)) |
self.AddUserStory(BlogSpotPage(self)) |
self.AddUserStory(FacebookPage(self)) |