[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / tools / perf / page_sets / tough_compositor_cases.py
blobbdaaf7564b9664f077617db8b3ebf0c37cb93265
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 from telemetry.page import page as page_module
5 from telemetry.page import shared_page_state
6 from telemetry import story
9 class ToughCompositorPage(page_module.Page):
11 def __init__(self, url, page_set):
12 super(ToughCompositorPage, self).__init__(
13 url=url, page_set=page_set, credentials_path = 'data/credentials.json',
14 shared_page_state_class=shared_page_state.SharedMobilePageState)
15 self.archive_data_file = 'data/tough_compositor_cases.json'
17 def RunNavigateSteps(self, action_runner):
18 super(ToughCompositorPage, self).RunNavigateSteps(action_runner)
19 # TODO(epenner): Remove this wait (http://crbug.com/366933)
20 action_runner.Wait(5)
22 class ToughCompositorScrollPage(ToughCompositorPage):
24 def __init__(self, url, page_set):
25 super(ToughCompositorScrollPage, self).__init__(url=url, page_set=page_set)
27 def RunPageInteractions(self, action_runner):
28 # Make the scroll longer to reduce noise.
29 with action_runner.CreateGestureInteraction('ScrollAction'):
30 action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=300)
32 class ToughCompositorWaitPage(ToughCompositorPage):
34 def __init__(self, url, page_set):
35 super(ToughCompositorWaitPage, self).__init__(url=url, page_set=page_set)
37 def RunPageInteractions(self, action_runner):
38 # We scroll back and forth a few times to reduce noise in the tests.
39 with action_runner.CreateInteraction('Animation'):
40 action_runner.Wait(8)
43 class ToughCompositorCasesPageSet(story.StorySet):
45 """ Touch compositor sites """
47 def __init__(self):
48 super(ToughCompositorCasesPageSet, self).__init__(
49 archive_data_file='data/tough_compositor_cases.json',
50 cloud_storage_bucket=story.PUBLIC_BUCKET)
52 scroll_urls_list = [
53 # Why: Baseline CC scrolling page. A long page with only text. """
54 'http://jsbin.com/pixavefe/1/quiet?CC_SCROLL_TEXT_ONLY',
55 # Why: Baseline JS scrolling page. A long page with only text. """
56 'http://jsbin.com/wixadinu/2/quiet?JS_SCROLL_TEXT_ONLY',
57 # Why: Scroll by a large number of CC layers """
58 'http://jsbin.com/yakagevo/1/quiet?CC_SCROLL_200_LAYER_GRID',
59 # Why: Scroll by a large number of JS layers """
60 'http://jsbin.com/jevibahi/4/quiet?JS_SCROLL_200_LAYER_GRID',
63 wait_urls_list = [
64 # Why: CC Poster circle animates many layers """
65 'http://jsbin.com/falefice/1/quiet?CC_POSTER_CIRCLE',
66 # Why: JS poster circle animates/commits many layers """
67 'http://jsbin.com/giqafofe/1/quiet?JS_POSTER_CIRCLE',
68 # Why: JS invalidation does lots of uploads """
69 'http://jsbin.com/beqojupo/1/quiet?JS_FULL_SCREEN_INVALIDATION',
70 # Why: Creates a large number of new tilings """
71 'http://jsbin.com/covoqi/1/quiet?NEW_TILINGS',
74 for url in scroll_urls_list:
75 self.AddStory(ToughCompositorScrollPage(url, self))
77 for url in wait_urls_list:
78 self.AddStory(ToughCompositorWaitPage(url, self))