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 # pylint: disable=W0401,W0614
5 from telemetry.page.actions.all_page_actions import *
6 from telemetry.page import page as page_module
7 from telemetry.page import page_set as page_set_module
10 class ToughWebglCasesPage(page_module.Page):
12 def __init__(self, url, page_set):
13 super(ToughWebglCasesPage, self).__init__(url=url, page_set=page_set)
14 self.archive_data_file = 'data/tough_webgl_cases.json'
16 def RunNavigateSteps(self, action_runner):
17 action_runner.RunAction(NavigateAction())
18 action_runner.RunAction(WaitAction(
20 'javascript': 'document.readyState == "complete"'
22 action_runner.RunAction(WaitAction({'seconds': 2}))
24 def RunSmoothness(self, action_runner):
25 action_runner.RunAction(WaitAction({'seconds': 5}))
28 class Page1(ToughWebglCasesPage):
31 Why: Observed performance regression with this demo in M33
34 def __init__(self, page_set):
35 super(Page1, self).__init__(
36 url='http://montagestudio.com/demos/eco-homes/',
39 def RunNavigateSteps(self, action_runner):
40 action_runner.RunAction(NavigateAction())
41 action_runner.RunAction(WaitAction(
43 'javascript': 'document.readyState == "complete"'
45 action_runner.RunAction(WaitAction({'seconds': 15}))
48 class Page2(ToughWebglCasesPage):
50 def __init__(self, page_set):
51 super(Page2, self).__init__(
52 url='http://helloracer.com/racer-s/',
55 def RunNavigateSteps(self, action_runner):
56 action_runner.RunAction(NavigateAction())
57 action_runner.RunAction(WaitAction(
59 'javascript': 'document.readyState == "complete"'
61 action_runner.RunAction(WaitAction({'seconds': 10}))
64 class ToughWebglCasesPageSet(page_set_module.PageSet):
67 Description: Self-driven WebGL animation examples
71 super(ToughWebglCasesPageSet, self).__init__(
72 archive_data_file='data/tough_webgl_cases.json')
74 self.AddPage(Page1(self))
75 self.AddPage(Page2(self))
77 # pylint: disable=C0301
78 'http://www.khronos.org/registry/webgl/sdk/demos/google/nvidia-vertex-buffer-object/index.html',
79 # pylint: disable=C0301
80 'http://www.khronos.org/registry/webgl/sdk/demos/google/san-angeles/index.html',
81 # pylint: disable=C0301
82 'http://www.khronos.org/registry/webgl/sdk/demos/google/particles/index.html',
83 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/Earth.html',
84 # pylint: disable=C0301
85 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/ManyPlanetsDeep.html',
86 'http://webglsamples.googlecode.com/hg/aquarium/aquarium.html',
87 'http://webglsamples.googlecode.com/hg/blob/blob.html',
88 # pylint: disable=C0301
89 'http://webglsamples.googlecode.com/hg/dynamic-cubemap/dynamic-cubemap.html'
92 self.AddPage(ToughWebglCasesPage(url, self))