| 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 google_login | 8 from page_sets.login_helpers import google_login |
| 9 from page_sets.login_helpers import pandora_login | 9 from page_sets.login_helpers import pandora_login |
| 10 | 10 |
| 11 | 11 |
| 12 class _MediaStory(system_health_story.SystemHealthStory): | 12 class _MediaStory(system_health_story.SystemHealthStory): |
| 13 """Abstract base class for media System Health user stories.""" | 13 """Abstract base class for media System Health user stories.""" |
| 14 | 14 |
| 15 ABSTRACT_STORY = True | 15 ABSTRACT_STORY = True |
| 16 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 16 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 17 PLAY_DURATION = 20 | 17 PLAY_DURATION = 20 |
| 18 PLAY_SELECTOR = NotImplemented | 18 PLAY_SELECTOR = NotImplemented |
| 19 STOP_SELECTOR = NotImplemented | 19 STOP_SELECTOR = NotImplemented |
| 20 TIME_SELECTOR = NotImplemented | 20 TIME_SELECTOR = NotImplemented |
| 21 | 21 |
| 22 def RunPageInteractions(self, action_runner): | 22 def _DidLoadDocument(self, action_runner): |
| 23 self._NavigateToMedia(action_runner) | 23 self._NavigateToMedia(action_runner) |
| 24 # Play Media. | 24 # Play Media. |
| 25 if self.PLAY_SELECTOR: | 25 if self.PLAY_SELECTOR: |
| 26 self._WaitForAndClickElementBySelector(action_runner, self.PLAY_SELECTOR) | 26 self._WaitForAndClickElementBySelector(action_runner, self.PLAY_SELECTOR) |
| 27 self._WaitForPlayTime(action_runner) | 27 self._WaitForPlayTime(action_runner) |
| 28 # Stop media. | 28 # Stop media. |
| 29 self._WaitForAndClickElementBySelector(action_runner, self.STOP_SELECTOR) | 29 self._WaitForAndClickElementBySelector(action_runner, self.STOP_SELECTOR) |
| 30 | 30 |
| 31 def _NavigateToMedia(self, action_runner): | 31 def _NavigateToMedia(self, action_runner): |
| 32 raise NotImplementedError | 32 raise NotImplementedError |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 PLAY_SELECTOR = None | 104 PLAY_SELECTOR = None |
| 105 STOP_SELECTOR = '.pauseButton' | 105 STOP_SELECTOR = '.pauseButton' |
| 106 TIME_SELECTOR = '.elapsedTime' | 106 TIME_SELECTOR = '.elapsedTime' |
| 107 SEARCH_SELECTOR = '.searchInput' | 107 SEARCH_SELECTOR = '.searchInput' |
| 108 | 108 |
| 109 def _Login(self, action_runner): | 109 def _Login(self, action_runner): |
| 110 pandora_login.LoginAccount(action_runner, 'pandora', self.credentials_path) | 110 pandora_login.LoginAccount(action_runner, 'pandora', self.credentials_path) |
| 111 | 111 |
| 112 def _NavigateToMedia(self, action_runner): | 112 def _NavigateToMedia(self, action_runner): |
| 113 pass # Audio autoplays on Pandora, no need to search. | 113 pass # Audio autoplays on Pandora, no need to search. |
| OLD | NEW |