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)
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'):
43 class ToughCompositorCasesPageSet(story
.StorySet
):
45 """ Touch compositor sites """
48 super(ToughCompositorCasesPageSet
, self
).__init
__(
49 archive_data_file
='data/tough_compositor_cases.json',
50 cloud_storage_bucket
=story
.PUBLIC_BUCKET
)
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',
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
))