Commit 1cecab46 authored by Amy Qiu's avatar Amy Qiu Committed by Commit Bot

Merge tough_image_decode_cases into rendering page sets

Move tough_image_decode_cases into the rendering folder and refactor
classes to inherit from RenderingStory

Bug: 849392
Change-Id: I888b1226bc8663c28d79e5871215547af1052b4a
Reviewed-on: https://chromium-review.googlesource.com/1089203
Commit-Queue: Amy Qiu <amyqiu@google.com>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#565049}
parent f42dbfcc
......@@ -257,6 +257,12 @@
},
"google_image_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"cats_unscaled": {
"DEFAULT": "tough_image_decode_cases_000.wprgo"
},
"cats_viewport_width": {
"DEFAULT": "tough_image_decode_cases_000.wprgo"
}
},
"description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
......
......@@ -644,6 +644,12 @@
},
"google_image_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"cats_unscaled": {
"DEFAULT": "tough_image_decode_cases_000.wprgo"
},
"cats_viewport_width": {
"DEFAULT": "tough_image_decode_cases_000.wprgo"
}
},
"description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
......
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class ToughImageDecodeCasesPage(page_module.Page):
from page_sets.rendering import rendering_story
def __init__(self, url, name, page_set):
super(ToughImageDecodeCasesPage, self).__init__(
url=url,
class ToughImageDecodePage(rendering_story.RenderingStory):
ABSTRACT_STORY = True
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedMobilePageState,
name_suffix='',
extra_browser_args=None):
super(ToughImageDecodePage, self).__init__(
page_set=page_set,
name=name,
shared_page_state_class=shared_page_state.SharedMobilePageState)
shared_page_state_class=shared_page_state_class,
name_suffix=name_suffix,
extra_browser_args=extra_browser_args)
def RunPageInteractions(self, action_runner):
action_runner.WaitForJavaScriptCondition(
......@@ -21,6 +28,20 @@ class ToughImageDecodeCasesPage(page_module.Page):
with action_runner.CreateGestureInteraction('ScrollAction'):
action_runner.ScrollPage(direction='up', speed_in_pixels_per_second=5000)
class UnscaledImageDecodePage(ToughImageDecodePage):
BASE_NAME = 'cats_unscaled'
URL = 'http://localhost:9000/cats-unscaled.html'
class ViewPortWidthImageDecodePage(ToughImageDecodePage):
BASE_NAME = 'cats_viewport_width'
URL = 'http://localhost:9000/cats-viewport-width.html'
# TODO(crbug.com/760553):remove this class after
# smoothness.tough_image_decode_cases benchmark is completely
# replaced by rendering benchmarks
class ToughImageDecodeCasesPageSet(story.StorySet):
"""
......@@ -29,14 +50,13 @@ class ToughImageDecodeCasesPageSet(story.StorySet):
def __init__(self):
super(ToughImageDecodeCasesPageSet, self).__init__(
archive_data_file='data/tough_image_decode_cases.json',
archive_data_file='../data/tough_image_decode_cases.json',
cloud_storage_bucket=story.PUBLIC_BUCKET)
page_name_list = [
('cats_unscaled', 'http://localhost:9000/cats-unscaled.html'),
('cats_viewport_width', 'http://localhost:9000/cats-viewport-width.html')
page_classes = [
UnscaledImageDecodePage,
ViewPortWidthImageDecodePage
]
for name, url in page_name_list:
self.AddStory(ToughImageDecodeCasesPage(
url, name, self))
for page_class in page_classes:
self.AddStory(page_class(self))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment