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
__(url
=url
, page_set
=page_set
)
12 self
.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 credentials_path
='data/credentials.json',
50 user_agent_type
='mobile',
51 archive_data_file
='data/tough_compositor_cases.json',
52 bucket
=page_set_module
.PUBLIC_BUCKET
)
55 # Why: Baseline CC scrolling page. A long page with only text. """
56 'http://jsbin.com/pixavefe/1/quiet?CC_SCROLL_TEXT_ONLY',
57 # Why: Baseline JS scrolling page. A long page with only text. """
58 'http://jsbin.com/wixadinu/2/quiet?JS_SCROLL_TEXT_ONLY',
59 # Why: Scroll by a large number of CC layers """
60 'http://jsbin.com/yakagevo/1/quiet?CC_SCROLL_200_LAYER_GRID',
61 # Why: Scroll by a large number of JS layers """
62 'http://jsbin.com/jevibahi/4/quiet?JS_SCROLL_200_LAYER_GRID',
66 # Why: CC Poster circle animates many layers """
67 'http://jsbin.com/falefice/1/quiet?CC_POSTER_CIRCLE',
68 # Why: JS poster circle animates/commits many layers """
69 'http://jsbin.com/giqafofe/1/quiet?JS_POSTER_CIRCLE',
70 # Why: JS invalidation does lots of uploads """
71 'http://jsbin.com/beqojupo/1/quiet?JS_FULL_SCREEN_INVALIDATION',
74 for url
in scroll_urls_list
:
75 self
.AddPage(ToughCompositorScrollPage(url
, self
))
77 for url
in wait_urls_list
:
78 self
.AddPage(ToughCompositorWaitPage(url
, self
))