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..742c8ad17025c307ad0c4746e0622dd5e0985032 |
| --- /dev/null |
| +++ b/tools/perf/page_sets/system_health/background_stories.py |
| @@ -0,0 +1,43 @@ |
| +# 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 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() |
| + super(_BackgroundStory, self)._Measure(action_runner) |
| + |
| + |
| +class BackgroundGoogleStory(_BackgroundStory): |
| + NAME = 'background:search:google' |
| + URL = 'https://www.google.co.uk/' |
|
nednguyen
2016/10/05 15:15:22
Can you change this to https://www.google.co.uk/#q
hjd
2016/10/06 11:23:41
Done :)
|
| + |
| + |
| +class BackgroundFacebookMobileStory(_BackgroundStory): |
| + NAME = 'background:social:facebook' |
| + URL = 'https://www.facebook.com/rihanna' |
| + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| + |
| + |
| +class BackgroundNytimesMobileStory(_BackgroundStory): |
| + """The third top website in http://www.alexa.com/topsites/category/News""" |
| + NAME = 'background:news:nytimes' |
| + URL = 'http://mobile.nytimes.com' |
|
nednguyen
2016/10/05 15:15:23
Can you use http://www.nytimes.com/2016/10/04/us/p
hjd
2016/10/06 11:23:41
Done.
|
| + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| + |
| + |
| +class BackgroundImgurMobileStory(_BackgroundStory): |
| + NAME = 'background:media:imgur' |
| + URL = 'http://imgur.com/gallery/5UlBN' |
|
nednguyen
2016/10/05 15:15:22
How about using http://imgur.com/gallery/hUita ?
hjd
2016/10/06 11:23:41
Done.
|
| + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |