OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 from page_sets import webgl_supported_shared_state |
| 6 from telemetry import story |
5 from telemetry.page import page as page_module | 7 from telemetry.page import page as page_module |
6 from telemetry.page import page_set as page_set_module | |
7 | |
8 from page_sets import webgl_supported_shared_state | |
9 | 8 |
10 | 9 |
11 class ToughWebglCasesPage(page_module.Page): | 10 class ToughWebglCasesPage(page_module.Page): |
12 | 11 |
13 def __init__(self, url, page_set): | 12 def __init__(self, url, page_set): |
14 super(ToughWebglCasesPage, self).__init__( | 13 super(ToughWebglCasesPage, self).__init__( |
15 url=url, page_set=page_set, | 14 url=url, page_set=page_set, |
16 shared_page_state_class=( | 15 shared_page_state_class=( |
17 webgl_supported_shared_state.WebGLSupportedSharedState), | 16 webgl_supported_shared_state.WebGLSupportedSharedState), |
18 make_javascript_deterministic=False) | 17 make_javascript_deterministic=False) |
19 self.archive_data_file = 'data/tough_webgl_cases.json' | 18 self.archive_data_file = 'data/tough_webgl_cases.json' |
20 | 19 |
21 | 20 |
22 def RunNavigateSteps(self, action_runner): | 21 def RunNavigateSteps(self, action_runner): |
23 super(ToughWebglCasesPage, self).RunNavigateSteps(action_runner) | 22 super(ToughWebglCasesPage, self).RunNavigateSteps(action_runner) |
24 action_runner.WaitForJavaScriptCondition( | 23 action_runner.WaitForJavaScriptCondition( |
25 'document.readyState == "complete"') | 24 'document.readyState == "complete"') |
26 action_runner.Wait(2) | 25 action_runner.Wait(2) |
27 | 26 |
28 def RunPageInteractions(self, action_runner): | 27 def RunPageInteractions(self, action_runner): |
29 with action_runner.CreateInteraction('WebGLAnimation'): | 28 with action_runner.CreateInteraction('WebGLAnimation'): |
30 action_runner.Wait(5) | 29 action_runner.Wait(5) |
31 | 30 |
32 | 31 |
33 class ToughWebglCasesPageSet(page_set_module.PageSet): | 32 class ToughWebglCasesPageSet(story.StorySet): |
34 | 33 |
35 """ | 34 """ |
36 Description: Self-driven WebGL animation examples | 35 Description: Self-driven WebGL animation examples |
37 """ | 36 """ |
38 | 37 |
39 def __init__(self): | 38 def __init__(self): |
40 super(ToughWebglCasesPageSet, self).__init__( | 39 super(ToughWebglCasesPageSet, self).__init__( |
41 archive_data_file='data/tough_webgl_cases.json', | 40 archive_data_file='data/tough_webgl_cases.json', |
42 bucket=page_set_module.PUBLIC_BUCKET) | 41 cloud_storage_bucket=story.PUBLIC_BUCKET) |
43 | 42 |
44 urls_list = [ | 43 urls_list = [ |
45 # pylint: disable=C0301 | 44 # pylint: disable=C0301 |
46 'http://www.khronos.org/registry/webgl/sdk/demos/google/nvidia-vertex-buff
er-object/index.html', | 45 'http://www.khronos.org/registry/webgl/sdk/demos/google/nvidia-vertex-buff
er-object/index.html', |
47 # pylint: disable=C0301 | 46 # pylint: disable=C0301 |
48 'http://www.khronos.org/registry/webgl/sdk/demos/google/san-angeles/index.
html', | 47 'http://www.khronos.org/registry/webgl/sdk/demos/google/san-angeles/index.
html', |
49 # pylint: disable=C0301 | 48 # pylint: disable=C0301 |
50 'http://www.khronos.org/registry/webgl/sdk/demos/google/particles/index.ht
ml', | 49 'http://www.khronos.org/registry/webgl/sdk/demos/google/particles/index.ht
ml', |
51 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/Earth.html', | 50 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/Earth.html', |
52 # pylint: disable=C0301 | 51 # pylint: disable=C0301 |
53 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/ManyPlanetsDeep.ht
ml', | 52 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/ManyPlanetsDeep.ht
ml', |
54 'http://webglsamples.googlecode.com/hg/aquarium/aquarium.html', | 53 'http://webglsamples.googlecode.com/hg/aquarium/aquarium.html', |
55 'http://webglsamples.googlecode.com/hg/blob/blob.html', | 54 'http://webglsamples.googlecode.com/hg/blob/blob.html', |
56 # pylint: disable=C0301 | 55 # pylint: disable=C0301 |
57 'http://webglsamples.googlecode.com/hg/dynamic-cubemap/dynamic-cubemap.htm
l' | 56 'http://webglsamples.googlecode.com/hg/dynamic-cubemap/dynamic-cubemap.htm
l' |
58 ] | 57 ] |
59 for url in urls_list: | 58 for url in urls_list: |
60 self.AddUserStory(ToughWebglCasesPage(url, self)) | 59 self.AddUserStory(ToughWebglCasesPage(url, self)) |
OLD | NEW |