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..c129876290600033e7cc837de36eff7477e706db |
| --- /dev/null |
| +++ b/tools/perf/page_sets/system_health/background_stories.py |
| @@ -0,0 +1,26 @@ |
| +# 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 |
| + |
| +class _BackgroundStory(system_health_story.SystemHealthStory): |
| + """Abstract base class for background stories |
| + |
| + As a _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() |
|
nednguyen
2016/10/05 13:10:49
Should we wait few seconds after backgrounding to
perezju
2016/10/05 13:14:54
+1
hjd
2016/10/05 13:45:44
Sounds good; 2 seconds?
|
| + super(_BackgroundStory, self)._Measure(action_runner) |
| + action_runner.tab.browser.Foreground() |
|
nednguyen
2016/10/05 13:10:49
What happens if we don't foreground here? Would th
perezju
2016/10/05 13:14:54
I agree, we probably don't need to "Foreground" ag
hjd
2016/10/05 13:45:44
Yep the restart brings up the browser again :) Sha
|
| + |
| + |
| +class BackgroundGoogleStory(_BackgroundStory): |
| + NAME = 'background:search:google' |
| + URL = 'https://www.google.co.uk/' |
|
nednguyen
2016/10/05 13:10:50
Given that we only have around 5 single page stori
perezju
2016/10/05 13:14:54
I'm coming up with a list of stories to pick. Will
|
| + |