1 # Copyright 2015 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
8 class ToughImageDecodeCasesPage(page_module
.Page
):
10 def __init__(self
, url
, name
, page_set
):
11 super(ToughImageDecodeCasesPage
, self
).__init
__(
15 shared_page_state_class
=shared_page_state
.SharedMobilePageState
)
16 self
.archive_data_file
= 'data/tough_image_decode_cases.json'
18 def RunPageInteractions(self
, action_runner
):
19 action_runner
.WaitForJavaScriptCondition(
20 'document.readyState === "complete"')
21 action_runner
.ScrollPage(direction
='down', speed_in_pixels_per_second
=5000)
22 with action_runner
.CreateGestureInteraction('ScrollAction'):
23 action_runner
.ScrollPage(direction
='up', speed_in_pixels_per_second
=5000)
25 class ToughImageDecodeCasesPageSet(story
.StorySet
):
28 Description: A collection of difficult image decode tests
32 super(ToughImageDecodeCasesPageSet
, self
).__init
__(
33 archive_data_file
='data/tough_image_decode_cases.json',
34 cloud_storage_bucket
=story
.PUBLIC_BUCKET
)
37 'http://localhost:9000/cats-unscaled.html',
38 'http://localhost:9000/cats-viewport-width.html'
41 for name
in page_name_list
:
42 self
.AddStory(ToughImageDecodeCasesPage(