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

Side by Side Diff: tools/perf/page_sets/key_desktop_move_cases.py

Issue 1087023003: [Telemetry] Remove action_runner.BeginGestureInteraction. (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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/action_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 from telemetry.page import page as page_module 4 from telemetry.page import page as page_module
5 from telemetry.page import page_set as page_set_module 5 from telemetry.page import page_set as page_set_module
6 6
7 7
8 class KeyDesktopMoveCasesPage(page_module.Page): 8 class KeyDesktopMoveCasesPage(page_module.Page):
9 9
10 def __init__(self, url, page_set, name='', credentials=None): 10 def __init__(self, url, page_set, name='', credentials=None):
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 def RunPageInteractions(self, action_runner): 45 def RunPageInteractions(self, action_runner):
46 action_runner.ExecuteJavaScript(''' 46 action_runner.ExecuteJavaScript('''
47 gmonkey.load('2.0', function(api) { 47 gmonkey.load('2.0', function(api) {
48 window.__scrollableElementForTelemetry = api.getScrollableElement(); 48 window.__scrollableElementForTelemetry = api.getScrollableElement();
49 });''') 49 });''')
50 action_runner.WaitForJavaScriptCondition( 50 action_runner.WaitForJavaScriptCondition(
51 'window.__scrollableElementForTelemetry != null') 51 'window.__scrollableElementForTelemetry != null')
52 scrollbar_x, start_y, end_y = self._CalculateScrollBarRatios(action_runner) 52 scrollbar_x, start_y, end_y = self._CalculateScrollBarRatios(action_runner)
53 53
54 interaction = action_runner.BeginGestureInteraction( 54 with action_runner.CreateGestureInteraction('DragAction'):
55 'DragAction') 55 action_runner.DragPage(left_start_ratio=scrollbar_x,
56 action_runner.DragPage(left_start_ratio=scrollbar_x, 56 top_start_ratio=start_y, left_end_ratio=scrollbar_x,
57 top_start_ratio=start_y, left_end_ratio=scrollbar_x, 57 top_end_ratio=end_y, speed_in_pixels_per_second=100,
58 top_end_ratio=end_y, speed_in_pixels_per_second=100, 58 element_function='window.__scrollableElementForTelemetry')
59 element_function='window.__scrollableElementForTelemetry')
60 interaction.End()
61 59
62 def _CalculateScrollBarRatios(self, action_runner): 60 def _CalculateScrollBarRatios(self, action_runner):
63 viewport_height = float(action_runner.EvaluateJavaScript( 61 viewport_height = float(action_runner.EvaluateJavaScript(
64 'window.__scrollableElementForTelemetry.clientHeight')) 62 'window.__scrollableElementForTelemetry.clientHeight'))
65 content_height = float(action_runner.EvaluateJavaScript( 63 content_height = float(action_runner.EvaluateJavaScript(
66 'window.__scrollableElementForTelemetry.scrollHeight')) 64 'window.__scrollableElementForTelemetry.scrollHeight'))
67 viewport_width = float(action_runner.EvaluateJavaScript( 65 viewport_width = float(action_runner.EvaluateJavaScript(
68 'window.__scrollableElementForTelemetry.offsetWidth')) 66 'window.__scrollableElementForTelemetry.offsetWidth'))
69 scrollbar_width = float(action_runner.EvaluateJavaScript(''' 67 scrollbar_width = float(action_runner.EvaluateJavaScript('''
70 window.__scrollableElementForTelemetry.offsetWidth - 68 window.__scrollableElementForTelemetry.offsetWidth -
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 112
115 """ Special cases for move gesture """ 113 """ Special cases for move gesture """
116 114
117 def __init__(self): 115 def __init__(self):
118 super(KeyDesktopMoveCasesPageSet, self).__init__( 116 super(KeyDesktopMoveCasesPageSet, self).__init__(
119 archive_data_file='data/key_desktop_move_cases.json', 117 archive_data_file='data/key_desktop_move_cases.json',
120 bucket=page_set_module.PARTNER_BUCKET) 118 bucket=page_set_module.PARTNER_BUCKET)
121 119
122 self.AddUserStory(GmailMouseScrollPage(self)) 120 self.AddUserStory(GmailMouseScrollPage(self))
123 self.AddUserStory(GoogleMapsPage(self)) 121 self.AddUserStory(GoogleMapsPage(self))
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/action_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698