| 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 import logging | 5 import logging |
| 6 | 6 |
| 7 from page_sets.system_health import platforms | 7 from page_sets.system_health import platforms |
| 8 | 8 |
| 9 from telemetry.page import page | 9 from telemetry.page import page |
| 10 | 10 |
| 11 | 11 |
| 12 _DUMP_WAIT_TIME = 3 | 12 _DUMP_WAIT_TIME = 3 |
| 13 | 13 |
| 14 | 14 |
| 15 class _MetaSystemHealthStory(type): | 15 class _MetaSystemHealthStory(type): |
| 16 """Metaclass for SystemHealthStory.""" | 16 """Metaclass for SystemHealthStory.""" |
| 17 | 17 |
| 18 @property | 18 @property |
| 19 def ABSTRACT_STORY(cls): | 19 def ABSTRACT_STORY(cls): |
| 20 """Class field marking whether the class is abstract. | 20 """Class field marking whether the class is abstract. |
| 21 | 21 |
| 22 If true, the story will NOT be instantiated and added to a System Health | 22 If true, the story will NOT be instantiated and added to a System Health |
| 23 story set. This field is NOT inherited by subclasses (that's why it's | 23 story set. This field is NOT inherited by subclasses (that's why it's |
| 24 defined on the metaclass). | 24 defined on the metaclass). |
| 25 """ | 25 """ |
| 26 return cls.__dict__.get('__ABSTRACT_STORY__', False) | 26 return cls.__dict__.get('ABSTRACT_STORY', False) |
| 27 | |
| 28 @ABSTRACT_STORY.setter | |
| 29 def ABSTRACT_STORY(cls, ABSTRACT_STORY): | |
| 30 cls.__dict__['__ABSTRACT_STORY__'] = ABSTRACT_STORY | |
| 31 | 27 |
| 32 | 28 |
| 33 class SystemHealthStory(page.Page): | 29 class SystemHealthStory(page.Page): |
| 34 """Abstract base class for System Health user stories.""" | 30 """Abstract base class for System Health user stories.""" |
| 35 __metaclass__ = _MetaSystemHealthStory | 31 __metaclass__ = _MetaSystemHealthStory |
| 36 | 32 |
| 37 # The full name of a single page story has the form CASE:GROUP:PAGE (e.g. | 33 # The full name of a single page story has the form CASE:GROUP:PAGE (e.g. |
| 38 # 'load:search:google'). | 34 # 'load:search:google'). |
| 39 NAME = NotImplemented | 35 NAME = NotImplemented |
| 40 URL = NotImplemented | 36 URL = NotImplemented |
| (...skipping 30 matching lines...) Expand all Loading... |
| 71 pass | 67 pass |
| 72 | 68 |
| 73 def RunNavigateSteps(self, action_runner): | 69 def RunNavigateSteps(self, action_runner): |
| 74 self._Login(action_runner) | 70 self._Login(action_runner) |
| 75 super(SystemHealthStory, self).RunNavigateSteps(action_runner) | 71 super(SystemHealthStory, self).RunNavigateSteps(action_runner) |
| 76 | 72 |
| 77 def RunPageInteractions(self, action_runner): | 73 def RunPageInteractions(self, action_runner): |
| 78 action_runner.tab.WaitForDocumentReadyStateToBeComplete() | 74 action_runner.tab.WaitForDocumentReadyStateToBeComplete() |
| 79 self._DidLoadDocument(action_runner) | 75 self._DidLoadDocument(action_runner) |
| 80 self._Measure(action_runner) | 76 self._Measure(action_runner) |
| OLD | NEW |