OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 | 4 |
5 from page_sets.system_health import platforms | 5 from page_sets.system_health import platforms |
6 from page_sets.system_health import system_health_story | 6 from page_sets.system_health import system_health_story |
7 | 7 |
8 from page_sets.login_helpers import pinterest_login | 8 from page_sets.login_helpers import pinterest_login |
9 | 9 |
10 from telemetry import decorators | 10 from telemetry import decorators |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 # crash with OOM. | 89 # crash with OOM. |
90 @decorators.Disabled('android') | 90 @decorators.Disabled('android') |
91 class CnnStory(_NewsBrowsingStory): | 91 class CnnStory(_NewsBrowsingStory): |
92 """The second top website in http://www.alexa.com/topsites/category/News""" | 92 """The second top website in http://www.alexa.com/topsites/category/News""" |
93 NAME = 'browse:news:cnn' | 93 NAME = 'browse:news:cnn' |
94 URL = 'http://edition.cnn.com/' | 94 URL = 'http://edition.cnn.com/' |
95 ITEM_SELECTOR = '.cd__content > h3 > a' | 95 ITEM_SELECTOR = '.cd__content > h3 > a' |
96 ITEMS_TO_VISIT = 2 | 96 ITEMS_TO_VISIT = 2 |
97 | 97 |
98 | 98 |
99 @decorators.Disabled('android') # crbug.com/664518 | |
100 class FacebookMobileStory(_NewsBrowsingStory): | 99 class FacebookMobileStory(_NewsBrowsingStory): |
101 NAME = 'browse:social:facebook' | 100 NAME = 'browse:social:facebook' |
102 URL = 'https://www.facebook.com/rihanna' | 101 URL = 'https://www.facebook.com/rihanna' |
103 ITEM_SELECTOR = 'article ._5msj' | 102 ITEM_SELECTOR = 'article ._5msj' |
104 # We scroll further than usual so that Facebook fetches enough items | 103 # We scroll further than usual so that Facebook fetches enough items |
105 # (crbug.com/631022) | 104 # (crbug.com/631022) |
106 MAIN_PAGE_SCROLL_REPEAT = 1 | 105 MAIN_PAGE_SCROLL_REPEAT = 1 |
107 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 106 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
108 | 107 |
109 | 108 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 if self.INCREMENT_INDEX_AFTER_EACH_ITEM: | 250 if self.INCREMENT_INDEX_AFTER_EACH_ITEM: |
252 index += 1 | 251 index += 1 |
253 | 252 |
254 | 253 |
255 def _ViewMediaItem(self, action_runner, index): | 254 def _ViewMediaItem(self, action_runner, index): |
256 del index # Unused. | 255 del index # Unused. |
257 action_runner.tab.WaitForDocumentReadyStateToBeComplete() | 256 action_runner.tab.WaitForDocumentReadyStateToBeComplete() |
258 action_runner.Wait(self.ITEM_VIEW_TIME_IN_SECONDS) | 257 action_runner.Wait(self.ITEM_VIEW_TIME_IN_SECONDS) |
259 | 258 |
260 | 259 |
261 @decorators.Disabled('android') # crbug.com/664518 | |
262 class ImgurMobileStory(_MediaBrowsingStory): | 260 class ImgurMobileStory(_MediaBrowsingStory): |
263 NAME = 'browse:media:imgur' | 261 NAME = 'browse:media:imgur' |
264 URL = 'http://imgur.com/gallery/5UlBN' | 262 URL = 'http://imgur.com/gallery/5UlBN' |
265 ITEM_SELECTOR = '.Navbar-customAction' | 263 ITEM_SELECTOR = '.Navbar-customAction' |
266 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 264 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
267 IS_SINGLE_PAGE_APP = True | 265 IS_SINGLE_PAGE_APP = True |
268 | 266 |
269 | 267 |
270 class ImgurDesktopStory(_MediaBrowsingStory): | 268 class ImgurDesktopStory(_MediaBrowsingStory): |
271 NAME = 'browse:media:imgur' | 269 NAME = 'browse:media:imgur' |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 inner_save_function = 'document.querySelector(".nameAndIcons")' | 360 inner_save_function = 'document.querySelector(".nameAndIcons")' |
363 action_runner.WaitForElement(element_function=inner_save_function) | 361 action_runner.WaitForElement(element_function=inner_save_function) |
364 action_runner.ClickElement(element_function=inner_save_function) | 362 action_runner.ClickElement(element_function=inner_save_function) |
365 action_runner.Wait(1) # Wait to make navigation realistic. | 363 action_runner.Wait(1) # Wait to make navigation realistic. |
366 | 364 |
367 # Close selection. | 365 # Close selection. |
368 x_element_function = ('document.querySelector(' | 366 x_element_function = ('document.querySelector(' |
369 '".Button.borderless.close.visible")') | 367 '".Button.borderless.close.visible")') |
370 action_runner.ClickElement(element_function=x_element_function) | 368 action_runner.ClickElement(element_function=x_element_function) |
371 action_runner.Wait(1) # Wait to make navigation realistic. | 369 action_runner.Wait(1) # Wait to make navigation realistic. |
OLD | NEW |