OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 shared_page_state | 5 from telemetry.page import shared_page_state |
6 from telemetry import story | 6 from telemetry import story |
7 | 7 |
8 from page_sets.login_helpers import google_login | 8 from page_sets.login_helpers import google_login |
9 from page_sets import top_pages | 9 from page_sets import top_pages |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 # legacy and new login flow. | 50 # legacy and new login flow. |
51 super(GmailSmoothPage, self).__init__( | 51 super(GmailSmoothPage, self).__init__( |
52 url='https://mail.google.com/mail/', | 52 url='https://mail.google.com/mail/', |
53 page_set=page_set, | 53 page_set=page_set, |
54 shared_page_state_class=shared_page_state_class) | 54 shared_page_state_class=shared_page_state_class) |
55 | 55 |
56 def RunNavigateSteps(self, action_runner): | 56 def RunNavigateSteps(self, action_runner): |
57 google_login.LoginGoogleAccount(action_runner, 'google3', | 57 google_login.LoginGoogleAccount(action_runner, 'google3', |
58 self.credentials_path) | 58 self.credentials_path) |
59 super(GmailSmoothPage, self).RunNavigateSteps(action_runner) | 59 super(GmailSmoothPage, self).RunNavigateSteps(action_runner) |
60 action_runner.WaitForJavaScriptCondition2( | 60 action_runner.WaitForJavaScriptCondition( |
61 'window.gmonkey !== undefined &&' | 61 'window.gmonkey !== undefined &&' |
62 'document.getElementById("gb") !== null', | 62 'document.getElementById("gb") !== null', |
63 timeout=120) | 63 timeout=120) |
64 | 64 |
65 def RunPageInteractions(self, action_runner): | 65 def RunPageInteractions(self, action_runner): |
66 action_runner.ExecuteJavaScript2(''' | 66 action_runner.ExecuteJavaScript(''' |
67 gmonkey.load('2.0', function(api) { | 67 gmonkey.load('2.0', function(api) { |
68 window.__scrollableElementForTelemetry = api.getScrollableElement(); | 68 window.__scrollableElementForTelemetry = api.getScrollableElement(); |
69 });''') | 69 });''') |
70 action_runner.WaitForJavaScriptCondition2( | 70 action_runner.WaitForJavaScriptCondition( |
71 'window.__scrollableElementForTelemetry != null') | 71 'window.__scrollableElementForTelemetry != null') |
72 action_runner.Wait(1) | 72 action_runner.Wait(1) |
73 with action_runner.CreateGestureInteraction('ScrollAction'): | 73 with action_runner.CreateGestureInteraction('ScrollAction'): |
74 action_runner.ScrollElement( | 74 action_runner.ScrollElement( |
75 element_function='window.__scrollableElementForTelemetry') | 75 element_function='window.__scrollableElementForTelemetry') |
76 | 76 |
77 | 77 |
78 class GoogleCalendarSmoothPage(top_pages.GoogleCalendarPage): | 78 class GoogleCalendarSmoothPage(top_pages.GoogleCalendarPage): |
79 | 79 |
80 """ Why: productivity, top google properties """ | 80 """ Why: productivity, top google properties """ |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 other_urls.append('http://techcrunch.com') | 171 other_urls.append('http://techcrunch.com') |
172 | 172 |
173 for url in other_urls: | 173 for url in other_urls: |
174 self.AddStory(TopSmoothPage(url, self)) | 174 self.AddStory(TopSmoothPage(url, self)) |
175 | 175 |
176 | 176 |
177 class V8Top25SmoothPageSet(Top25SmoothPageSet): | 177 class V8Top25SmoothPageSet(Top25SmoothPageSet): |
178 def __init__(self): | 178 def __init__(self): |
179 # Disabled for V8 because of crbug.com/507836, crbug.com/527425 | 179 # Disabled for V8 because of crbug.com/507836, crbug.com/527425 |
180 super(V8Top25SmoothPageSet, self).__init__(techcrunch=False) | 180 super(V8Top25SmoothPageSet, self).__init__(techcrunch=False) |
OLD | NEW |