From 7c8b08dec98fb1c4c6e52c2aa2a90d3a5c7a01cd Mon Sep 17 00:00:00 2001 From: nednguyen Date: Tue, 14 Apr 2015 18:27:36 -0700 Subject: [PATCH] [Telemetry] Switch BeginGestureInteraction to CreateGestureInteraction. BUG=475090 Review URL: https://codereview.chromium.org/1086003002 Cr-Commit-Position: refs/heads/master@{#325167} --- tools/perf/page_sets/alexa1-10000.py | 6 ++---- tools/perf/page_sets/key_desktop_move_cases.py | 9 ++++----- tools/perf/page_sets/top_desktop_sites_2012Q3.py | 6 ++---- tools/perf/page_sets/tough_scrolling_cases.py | 17 +++++++---------- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/tools/perf/page_sets/alexa1-10000.py b/tools/perf/page_sets/alexa1-10000.py index 0f890c655db0..db72102b578f 100644 --- a/tools/perf/page_sets/alexa1-10000.py +++ b/tools/perf/page_sets/alexa1-10000.py @@ -22,10 +22,8 @@ class Alexa1To10000Page(Page): super(Alexa1To10000Page, self).__init__(url=url, page_set=page_set) def RunPageInteractions(self, action_runner): - interaction = action_runner.BeginGestureInteraction( - 'ScrollAction') - action_runner.ScrollPage() - interaction.End() + with action_runner.CreateGestureInteraction('ScrollAction'): + action_runner.ScrollPage() class Alexa1To10000PageSet(PageSet): diff --git a/tools/perf/page_sets/key_desktop_move_cases.py b/tools/perf/page_sets/key_desktop_move_cases.py index ded7d6293167..c322ddf93907 100644 --- a/tools/perf/page_sets/key_desktop_move_cases.py +++ b/tools/perf/page_sets/key_desktop_move_cases.py @@ -103,11 +103,10 @@ class GoogleMapsPage(KeyDesktopMoveCasesPage): def RunPageInteractions(self, action_runner): for _ in range(3): action_runner.Wait(2) - interaction = action_runner.BeginGestureInteraction( - 'DragAction', repeatable=True) - action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.75, - left_end_ratio=0.75, top_end_ratio=0.5) - interaction.End() + with action_runner.CreateGestureInteraction( + 'DragAction', repeatable=True): + action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.75, + left_end_ratio=0.75, top_end_ratio=0.5) # TODO(ssid): Add zoom gestures after fixing bug crbug.com/462214. diff --git a/tools/perf/page_sets/top_desktop_sites_2012Q3.py b/tools/perf/page_sets/top_desktop_sites_2012Q3.py index 65d09427291d..667d8255e848 100644 --- a/tools/perf/page_sets/top_desktop_sites_2012Q3.py +++ b/tools/perf/page_sets/top_desktop_sites_2012Q3.py @@ -255,10 +255,8 @@ class Top2012Q3Page(page.Page): self.archive_data_file = 'data/2012Q3.json' def RunPageInteractions(self, action_runner): - interaction = action_runner.BeginGestureInteraction( - 'ScrollAction') - action_runner.ScrollPage() - interaction.End() + with action_runner.CreateGestureInteraction('ScrollAction'): + action_runner.ScrollPage() class Top2012Q3PageSet(page_set.PageSet): diff --git a/tools/perf/page_sets/tough_scrolling_cases.py b/tools/perf/page_sets/tough_scrolling_cases.py index f8ac723047c1..a1c2adfa3b5f 100644 --- a/tools/perf/page_sets/tough_scrolling_cases.py +++ b/tools/perf/page_sets/tough_scrolling_cases.py @@ -11,10 +11,9 @@ class ToughScrollingCasesPage(page_module.Page): super(ToughScrollingCasesPage, self).__init__(url=url, page_set=page_set) def RunPageInteractions(self, action_runner): - interaction = action_runner.BeginGestureInteraction( - 'ScrollAction') - action_runner.ScrollPage() - interaction.End() + with action_runner.CreateGestureInteraction('ScrollAction'): + action_runner.ScrollPage() + class ToughFastScrollingCasesPage(page_module.Page): @@ -27,12 +26,10 @@ class ToughFastScrollingCasesPage(page_module.Page): self.speed_in_pixels_per_second = speed_in_pixels_per_second def RunPageInteractions(self, action_runner): - interaction = action_runner.BeginGestureInteraction( - 'ScrollAction') - action_runner.ScrollPage( - direction='down', - speed_in_pixels_per_second=self.speed_in_pixels_per_second) - interaction.End() + with action_runner.CreateGestureInteraction('ScrollAction'): + action_runner.ScrollPage( + direction='down', + speed_in_pixels_per_second=self.speed_in_pixels_per_second) class ToughScrollingCasesPageSet(page_set_module.PageSet): -- 2.11.4.GIT