1# Copyright 2018 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.
4from telemetry.page import shared_page_state
5
6from page_sets.rendering import rendering_story
7from page_sets.rendering import story_tags
8
9
10class BackdropFilterPage(rendering_story.RenderingStory):
11  ABSTRACT_STORY = True
12  TAGS = [story_tags.BACKDROP_FILTER]
13
14  def __init__(self,
15               page_set,
16               shared_page_state_class=shared_page_state.SharedPageState,
17               name_suffix='',
18               extra_browser_args=None):
19    super(BackdropFilterPage, self).__init__(
20        page_set=page_set,
21        shared_page_state_class=shared_page_state_class,
22        name_suffix=name_suffix,
23        extra_browser_args=extra_browser_args)
24
25  def RunNavigateSteps(self, action_runner):
26    super(BackdropFilterPage, self).RunNavigateSteps(action_runner)
27    action_runner.WaitForJavaScriptCondition('window.readyToStart')
28
29  def RunPageInteractions(self, action_runner):
30    with action_runner.CreateInteraction('LetAnimationRun'):
31      action_runner.ExecuteJavaScript('animateOneFrame()')
32      action_runner.WaitForJavaScriptCondition('window.animationDone')
33
34
35# Why: should hopefully get 60 fps when moving foregrounds blur a rotating
36# background.
37class BlurRotatingBackgroundPage(BackdropFilterPage):
38  BASE_NAME = 'blur_rotating_background'
39  URL = 'file://../backdrop_filter_cases/blur_rotating_background.html'
40