OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 unittest | 4 import unittest |
5 | 5 |
6 import test_expectations | 6 from gpu_tests import test_expectations |
7 | 7 |
8 from telemetry.page import page as page_module | 8 from telemetry.page import page as page_module |
9 from telemetry.story import story_set | 9 from telemetry.story import story_set |
10 | 10 |
11 class StubPlatform(object): | 11 class StubPlatform(object): |
12 def __init__(self, os_name, os_version_name=None): | 12 def __init__(self, os_name, os_version_name=None): |
13 self.os_name = os_name | 13 self.os_name = os_name |
14 self.os_version_name = os_version_name | 14 self.os_version_name = os_version_name |
15 | 15 |
16 def GetOSName(self): | 16 def GetOSName(self): |
17 return self.os_name | 17 return self.os_name |
18 | 18 |
19 def GetOSVersionName(self): | 19 def GetOSVersionName(self): |
20 return self.os_version_name | 20 return self.os_version_name |
21 | 21 |
22 | 22 |
23 class StubBrowser(object): | 23 class StubBrowser(object): |
24 def __init__(self, platform, browser_type=None): | 24 def __init__(self, platform, browser_type=None): |
25 self.platform = platform | 25 self.platform = platform |
26 self.browser_type = browser_type | 26 self.browser_type = browser_type |
27 | 27 |
28 @property | 28 @property |
29 def supports_system_info(self): | 29 def supports_system_info(self): |
30 return False | 30 return False |
31 | 31 |
32 def GetSystemInfo(self): | |
33 return self.system_info | |
34 | |
35 | 32 |
36 class SampleExpectationSubclass(test_expectations.Expectation): | 33 class SampleExpectationSubclass(test_expectations.Expectation): |
37 def __init__(self, expectation, pattern, conditions=None, bug=None): | 34 def __init__(self, expectation, pattern, conditions=None, bug=None): |
38 self.valid_condition_matched = False | 35 self.valid_condition_matched = False |
39 self.valid_condition_unmatched = False | 36 self.valid_condition_unmatched = False |
40 super(SampleExpectationSubclass, self).__init__( | 37 super(SampleExpectationSubclass, self).__init__( |
41 expectation, pattern, conditions=conditions, bug=bug) | 38 expectation, pattern, conditions=conditions, bug=bug) |
42 | 39 |
43 def ParseCondition(self, condition): | 40 def ParseCondition(self, condition): |
44 if condition == 'valid_condition_matched': | 41 if condition == 'valid_condition_matched': |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 page = page_module.Page('http://test.com/conformance/glsl/page00.html', ps) | 218 page = page_module.Page('http://test.com/conformance/glsl/page00.html', ps) |
222 self.assertExpectationEquals('fail', page) | 219 self.assertExpectationEquals('fail', page) |
223 page = page_module.Page('http://test.com/conformance/glsl/page15.html', ps) | 220 page = page_module.Page('http://test.com/conformance/glsl/page15.html', ps) |
224 self.assertExpectationEquals('skip', page) | 221 self.assertExpectationEquals('skip', page) |
225 | 222 |
226 def testQueryArgsAreStrippedFromFileURLs(self): | 223 def testQueryArgsAreStrippedFromFileURLs(self): |
227 ps = story_set.StorySet() | 224 ps = story_set.StorySet() |
228 page = page_module.Page( | 225 page = page_module.Page( |
229 'file://conformance/glsl/page15.html?webglVersion=2', ps) | 226 'file://conformance/glsl/page15.html?webglVersion=2', ps) |
230 self.assertExpectationEquals('skip', page) | 227 self.assertExpectationEquals('skip', page) |
OLD | NEW |