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 import logging |
| 5 |
4 # pylint: disable=W0401,W0614 | 6 # pylint: disable=W0401,W0614 |
5 from telemetry.page.actions.all_page_actions import * | 7 from telemetry.page.actions.all_page_actions import * |
6 from telemetry.page import page as page_module | 8 from telemetry.page import page as page_module |
7 from telemetry.page import page_set as page_set_module | 9 from telemetry.page import page_set as page_set_module |
8 | 10 |
9 | 11 |
10 class ToughWebglCasesPage(page_module.Page): | 12 class ToughWebglCasesPage(page_module.Page): |
11 | 13 |
12 def __init__(self, url, page_set): | 14 def __init__(self, url, page_set): |
13 super(ToughWebglCasesPage, self).__init__(url=url, page_set=page_set) | 15 super(ToughWebglCasesPage, self).__init__(url=url, page_set=page_set) |
14 self.archive_data_file = 'data/tough_webgl_cases.json' | 16 self.archive_data_file = 'data/tough_webgl_cases.json' |
15 | 17 |
| 18 def CanRunOnBrowser(self, browser_info): |
| 19 if not browser_info.HasWebGLSupport(): |
| 20 logging.warning('Browser does not support webgl, skipping test') |
| 21 return False |
| 22 return True |
| 23 |
16 def RunNavigateSteps(self, action_runner): | 24 def RunNavigateSteps(self, action_runner): |
17 action_runner.NavigateToPage(self) | 25 action_runner.NavigateToPage(self) |
18 action_runner.RunAction(WaitAction( | 26 action_runner.RunAction(WaitAction( |
19 { | 27 { |
20 'javascript': 'document.readyState == "complete"' | 28 'javascript': 'document.readyState == "complete"' |
21 })) | 29 })) |
22 action_runner.RunAction(WaitAction({'seconds': 2})) | 30 action_runner.RunAction(WaitAction({'seconds': 2})) |
23 | 31 |
24 def RunSmoothness(self, action_runner): | 32 def RunSmoothness(self, action_runner): |
25 action_runner.RunAction(WaitAction({'seconds': 5})) | 33 action_runner.RunAction(WaitAction({'seconds': 5})) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/Earth.html', | 91 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/Earth.html', |
84 # pylint: disable=C0301 | 92 # pylint: disable=C0301 |
85 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/ManyPlanetsDeep.ht
ml', | 93 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/ManyPlanetsDeep.ht
ml', |
86 'http://webglsamples.googlecode.com/hg/aquarium/aquarium.html', | 94 'http://webglsamples.googlecode.com/hg/aquarium/aquarium.html', |
87 'http://webglsamples.googlecode.com/hg/blob/blob.html', | 95 'http://webglsamples.googlecode.com/hg/blob/blob.html', |
88 # pylint: disable=C0301 | 96 # pylint: disable=C0301 |
89 'http://webglsamples.googlecode.com/hg/dynamic-cubemap/dynamic-cubemap.htm
l' | 97 'http://webglsamples.googlecode.com/hg/dynamic-cubemap/dynamic-cubemap.htm
l' |
90 ] | 98 ] |
91 for url in urls_list: | 99 for url in urls_list: |
92 self.AddPage(ToughWebglCasesPage(url, self)) | 100 self.AddPage(ToughWebglCasesPage(url, self)) |
OLD | NEW |