Chromium Code Reviews| Index: tools/perf/page_sets/system_health/background_stories.py |
| diff --git a/tools/perf/page_sets/system_health/background_stories.py b/tools/perf/page_sets/system_health/background_stories.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..92ec300f1c2466519b9149985b704210ba573cb6 |
| --- /dev/null |
| +++ b/tools/perf/page_sets/system_health/background_stories.py |
| @@ -0,0 +1,30 @@ |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +from page_sets.system_health import platforms |
| +from page_sets.system_health import system_health_story |
| + |
| +# Number of seconds to wait between backgrounding the browser and |
| +# measuring the memory use. |
| +PRE_MEASUREMENT_DELAY_SECONDS = 2 |
| + |
| +class _BackgroundStory(system_health_story.SystemHealthStory): |
| + """Abstract base class for background stories |
| + |
| + As in _LoadingStory except it puts the browser into the |
| + background before measuring. |
| + """ |
| + ABSTRACT_STORY = True |
| + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| + |
| + def _Measure(self, action_runner): |
| + action_runner.tab.browser.Background() |
| + action_runner.Wait(PRE_MEASUREMENT_DELAY_SECONDS) |
|
perezju
2016/10/05 13:55:38
Actually, no, sorry about that. The _Measure metho
hjd
2016/10/05 15:07:40
Done.
|
| + super(_BackgroundStory, self)._Measure(action_runner) |
| + |
| + |
| +class BackgroundGoogleStory(_BackgroundStory): |
| + NAME = 'background:search:google' |
| + URL = 'https://www.google.co.uk/' |
|
perezju
2016/10/05 13:55:38
My proposal would be to include:
- background:soc
hjd
2016/10/05 15:07:40
Done, except gmail which is a little tricky.
|
| + |