| 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 | 8 |
| 9 class _BrowsingStory(system_health_story.SystemHealthStory): | 9 class _BrowsingStory(system_health_story.SystemHealthStory): |
| 10 """Abstract base class for browsing stories. | 10 """Abstract base class for browsing stories. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 173 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 174 | 174 |
| 175 | 175 |
| 176 class WashingtonPostMobileStory(_NewsBrowsingStory): | 176 class WashingtonPostMobileStory(_NewsBrowsingStory): |
| 177 """Progressive website""" | 177 """Progressive website""" |
| 178 NAME = 'browse:news:washingtonpost' | 178 NAME = 'browse:news:washingtonpost' |
| 179 URL = 'https://www.washingtonpost.com/pwa' | 179 URL = 'https://www.washingtonpost.com/pwa' |
| 180 IS_SINGLE_PAGE_APP = True | 180 IS_SINGLE_PAGE_APP = True |
| 181 ITEM_SELECTOR = '.hed > a' | 181 ITEM_SELECTOR = '.hed > a' |
| 182 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 182 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 183 _CLOSE_BUTTON_SELECTOR = '.close' |
| 183 | 184 |
| 184 def _DidLoadDocument(self, action_runner): | 185 def _DidLoadDocument(self, action_runner): |
| 185 # Close the popup window. | 186 # Close the popup window. On Nexus 9 (and probably other tables) the popup |
| 186 action_runner.ClickElement(selector='.close') | 187 # window does not have a "Close" button, instead it has only a "Send link |
| 188 # to phone" button. So on tablets we run with the popup window open. The |
| 189 # popup is transparent, so this is mostly an aesthetical issue. |
| 190 has_button = action_runner.EvaluateJavaScript( |
| 191 '!!document.querySelector("%s")' % self._CLOSE_BUTTON_SELECTOR) |
| 192 if has_button: |
| 193 action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) |
| 187 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) | 194 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) |
| OLD | NEW |