| 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 from gpu_tests import test_expectations | 6 from gpu_tests import test_expectations |
| 7 | 7 |
| 8 class StubPlatform(object): | 8 class StubPlatform(object): |
| 9 def __init__(self, os_name, os_version_name=None): | 9 def __init__(self, os_name, os_version_name=None): |
| 10 self.os_name = os_name | 10 self.os_name = os_name |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 def SetExpectations(self): | 56 def SetExpectations(self): |
| 57 self.Fail('page1.html', ['win', 'mac'], bug=123) | 57 self.Fail('page1.html', ['win', 'mac'], bug=123) |
| 58 self.Fail('page2.html', ['vista'], bug=123) | 58 self.Fail('page2.html', ['vista'], bug=123) |
| 59 self.Fail('page3.html', bug=123) | 59 self.Fail('page3.html', bug=123) |
| 60 self.Fail('page4.*', bug=123) | 60 self.Fail('page4.*', bug=123) |
| 61 self.Fail('Pages.page_6') | 61 self.Fail('Pages.page_6') |
| 62 self.Fail('page7.html', ['mountainlion']) | 62 self.Fail('page7.html', ['mountainlion']) |
| 63 self.Fail('page8.html', ['mavericks']) | 63 self.Fail('page8.html', ['mavericks']) |
| 64 self.Fail('page9.html', ['yosemite']) | 64 self.Fail('page9.html', ['yosemite']) |
| 65 # Test browser conditions. | 65 # Test browser conditions. |
| 66 self.Fail('page10.html', ['android', 'android-webview-shell'], bug=456) | 66 self.Fail('page10.html', ['android', 'android-webview-instrumentation'], |
| 67 bug=456) |
| 67 # Test user defined conditions. | 68 # Test user defined conditions. |
| 68 self.Fail('page11.html', ['win', 'valid_condition_matched']) | 69 self.Fail('page11.html', ['win', 'valid_condition_matched']) |
| 69 self.Fail('page12.html', ['win', 'valid_condition_unmatched']) | 70 self.Fail('page12.html', ['win', 'valid_condition_unmatched']) |
| 70 # Test file:// scheme. | 71 # Test file:// scheme. |
| 71 self.Fail('conformance/attribs/page13.html') | 72 self.Fail('conformance/attribs/page13.html') |
| 72 # Test file:// scheme on Windows. | 73 # Test file:// scheme on Windows. |
| 73 self.Fail('conformance/attribs/page14.html', ['win']) | 74 self.Fail('conformance/attribs/page14.html', ['win']) |
| 74 # Explicitly matched paths have precedence over wildcards. | 75 # Explicitly matched paths have precedence over wildcards. |
| 75 self.Fail('conformance/glsl/*') | 76 self.Fail('conformance/glsl/*') |
| 76 self.Skip('conformance/glsl/page15.html') | 77 self.Skip('conformance/glsl/page15.html') |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 StubPlatform('mac', 'mavericks')) | 192 StubPlatform('mac', 'mavericks')) |
| 192 self.assertExpectationEquals('fail', url, | 193 self.assertExpectationEquals('fail', url, |
| 193 StubPlatform('mac', 'yosemite')) | 194 StubPlatform('mac', 'yosemite')) |
| 194 | 195 |
| 195 # Test browser type conditions. | 196 # Test browser type conditions. |
| 196 def testBrowserTypeConditions(self): | 197 def testBrowserTypeConditions(self): |
| 197 url = 'http://test.com/page10.html' | 198 url = 'http://test.com/page10.html' |
| 198 self.assertExpectationEquals('pass', url, StubPlatform('android'), | 199 self.assertExpectationEquals('pass', url, StubPlatform('android'), |
| 199 browser_type='android-content-shell') | 200 browser_type='android-content-shell') |
| 200 self.assertExpectationEquals('fail', url, StubPlatform('android'), | 201 self.assertExpectationEquals('fail', url, StubPlatform('android'), |
| 201 browser_type='android-webview-shell') | 202 browser_type='android-webview-instrumentation') |
| 202 | 203 |
| 203 # Tests with user-defined conditions. | 204 # Tests with user-defined conditions. |
| 204 def testUserDefinedConditions(self): | 205 def testUserDefinedConditions(self): |
| 205 url = 'http://test.com/page11.html' | 206 url = 'http://test.com/page11.html' |
| 206 self.assertExpectationEquals('fail', url, StubPlatform('win')) | 207 self.assertExpectationEquals('fail', url, StubPlatform('win')) |
| 207 url = 'http://test.com/page12.html' | 208 url = 'http://test.com/page12.html' |
| 208 self.assertExpectationEquals('pass', url, StubPlatform('win')) | 209 self.assertExpectationEquals('pass', url, StubPlatform('win')) |
| 209 | 210 |
| 210 # The file:// scheme is treated specially by Telemetry; it's | 211 # The file:// scheme is treated specially by Telemetry; it's |
| 211 # translated into an HTTP request against localhost. Expectations | 212 # translated into an HTTP request against localhost. Expectations |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 'Foo', | 252 'Foo', |
| 252 StubPlatform('win')) | 253 StubPlatform('win')) |
| 253 | 254 |
| 254 def testCaseInsensitivity(self): | 255 def testCaseInsensitivity(self): |
| 255 url = 'http://test.com/page1.html' | 256 url = 'http://test.com/page1.html' |
| 256 self.assertExpectationEquals('fail', url, StubPlatform('Win')) | 257 self.assertExpectationEquals('fail', url, StubPlatform('Win')) |
| 257 url = 'http://test.com/page2.html' | 258 url = 'http://test.com/page2.html' |
| 258 self.assertExpectationEquals('fail', url, StubPlatform('Win', 'Vista')) | 259 self.assertExpectationEquals('fail', url, StubPlatform('Win', 'Vista')) |
| 259 url = 'http://test.com/page10.html' | 260 url = 'http://test.com/page10.html' |
| 260 self.assertExpectationEquals('fail', url, StubPlatform('android'), | 261 self.assertExpectationEquals('fail', url, StubPlatform('android'), |
| 261 browser_type='Android-Webview-Shell') | 262 browser_type='Android-Webview-Instrumentation') |
| 262 | 263 |
| 263 def testASANExpectations(self): | 264 def testASANExpectations(self): |
| 264 url16 = 'page16.html' | 265 url16 = 'page16.html' |
| 265 url18 = 'page18.html' | 266 url18 = 'page18.html' |
| 266 self.assertExpectationEquals('pass', url16, StubPlatform('mac')) | 267 self.assertExpectationEquals('pass', url16, StubPlatform('mac')) |
| 267 self.assertExpectationEquals('fail', url18, StubPlatform('mac')) | 268 self.assertExpectationEquals('fail', url18, StubPlatform('mac')) |
| 268 self.setUpHelper(is_asan=True) | 269 self.setUpHelper(is_asan=True) |
| 269 self.assertExpectationEquals('fail', url16, StubPlatform('mac')) | 270 self.assertExpectationEquals('fail', url16, StubPlatform('mac')) |
| 270 self.assertExpectationEquals('skip', url18, StubPlatform('mac')) | 271 self.assertExpectationEquals('skip', url18, StubPlatform('mac')) |
| OLD | NEW |