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 page_set
as page_set_module
8 class ToughCompositorPage(page_module
.Page
):
10 def __init__(self
, url
, page_set
):
11 super(ToughCompositorPage
, self
).__init
__(
12 url
=url
, page_set
=page_set
, credentials_path
= 'data/credentials.json')
13 self
.user_agent_type
= 'mobile'
14 self
.archive_data_file
= 'data/tough_compositor_cases.json'
16 def RunNavigateSteps(self
, action_runner
):
17 action_runner
.NavigateToPage(self
)
18 # TODO(epenner): Remove this wait (http://crbug.com/366933)
21 class ToughCompositorScrollPage(ToughCompositorPage
):
23 def __init__(self
, url
, page_set
):
24 super(ToughCompositorScrollPage
, self
).__init
__(url
=url
, page_set
=page_set
)
26 def RunSmoothness(self
, action_runner
):
27 # Make the scroll longer to reduce noise.
28 interaction
= action_runner
.BeginGestureInteraction(
29 'ScrollAction', is_smooth
=True)
30 action_runner
.ScrollPage(direction
='down', speed_in_pixels_per_second
=300)
33 class ToughCompositorWaitPage(ToughCompositorPage
):
35 def __init__(self
, url
, page_set
):
36 super(ToughCompositorWaitPage
, self
).__init
__(url
=url
, page_set
=page_set
)
38 def RunSmoothness(self
, action_runner
):
39 # We scroll back and forth a few times to reduce noise in the tests.
43 class ToughCompositorCasesPageSet(page_set_module
.PageSet
):
45 """ Touch compositor sites """
48 super(ToughCompositorCasesPageSet
, self
).__init
__(
49 user_agent_type
='mobile',
50 archive_data_file
='data/tough_compositor_cases.json',
51 bucket
=page_set_module
.PUBLIC_BUCKET
)
54 # Why: Baseline CC scrolling page. A long page with only text. """
55 'http://jsbin.com/pixavefe/1/quiet?CC_SCROLL_TEXT_ONLY',
56 # Why: Baseline JS scrolling page. A long page with only text. """
57 'http://jsbin.com/wixadinu/2/quiet?JS_SCROLL_TEXT_ONLY',
58 # Why: Scroll by a large number of CC layers """
59 'http://jsbin.com/yakagevo/1/quiet?CC_SCROLL_200_LAYER_GRID',
60 # Why: Scroll by a large number of JS layers """
61 'http://jsbin.com/jevibahi/4/quiet?JS_SCROLL_200_LAYER_GRID',
65 # Why: CC Poster circle animates many layers """
66 'http://jsbin.com/falefice/1/quiet?CC_POSTER_CIRCLE',
67 # Why: JS poster circle animates/commits many layers """
68 'http://jsbin.com/giqafofe/1/quiet?JS_POSTER_CIRCLE',
69 # Why: JS invalidation does lots of uploads """
70 'http://jsbin.com/beqojupo/1/quiet?JS_FULL_SCREEN_INVALIDATION',
71 # Why: Creates a large number of new tilings """
72 'http://jsbin.com/covoqi/1/quiet?NEW_TILINGS',
75 for url
in scroll_urls_list
:
76 self
.AddPage(ToughCompositorScrollPage(url
, self
))
78 for url
in wait_urls_list
:
79 self
.AddPage(ToughCompositorWaitPage(url
, self
))