OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 collections | 4 import collections |
5 import itertools | 5 import itertools |
6 import os | 6 import os |
7 import unittest | 7 import unittest |
8 | 8 |
9 from telemetry.testing import fakes | 9 from telemetry.testing import fakes |
10 | 10 |
11 import fake_win_amd_gpu_info | 11 from gpu_tests import fake_win_amd_gpu_info |
12 import gpu_test_base | 12 from gpu_tests import gpu_test_base |
13 import path_util | 13 from gpu_tests import path_util |
14 import test_expectations | 14 from gpu_tests import test_expectations |
15 import webgl_conformance | 15 from gpu_tests import webgl_conformance |
16 import webgl_conformance_expectations | 16 from gpu_tests import webgl_conformance_expectations |
17 import webgl2_conformance_expectations | 17 from gpu_tests import webgl2_conformance_expectations |
18 | 18 |
19 class FakeWindowsPlatform(fakes.FakePlatform): | 19 class FakeWindowsPlatform(fakes.FakePlatform): |
20 @property | 20 @property |
21 def is_host_platform(self): | 21 def is_host_platform(self): |
22 return True | 22 return True |
23 | 23 |
24 def GetDeviceTypeName(self): | 24 def GetDeviceTypeName(self): |
25 return 'Desktop' | 25 return 'Desktop' |
26 | 26 |
27 def GetArchName(self): | 27 def GetArchName(self): |
(...skipping 11 matching lines...) Expand all Loading... |
39 super(FakePage, self).__init__( | 39 super(FakePage, self).__init__( |
40 name=('WebglConformance.%s' % | 40 name=('WebglConformance.%s' % |
41 url.replace('/', '_').replace('-', '_'). | 41 url.replace('/', '_').replace('-', '_'). |
42 replace('\\', '_').rpartition('.')[0].replace('.', '_')), | 42 replace('\\', '_').rpartition('.')[0].replace('.', '_')), |
43 url='file://' + url, | 43 url='file://' + url, |
44 page_set=None, | 44 page_set=None, |
45 shared_page_state_class=gpu_test_base.FakeGpuSharedPageState, | 45 shared_page_state_class=gpu_test_base.FakeGpuSharedPageState, |
46 expectations=expectations) | 46 expectations=expectations) |
47 | 47 |
48 Conditions = collections.\ | 48 Conditions = collections.\ |
49 namedtuple('Conditions', ['non_gpu', 'vendors', 'devices']); | 49 namedtuple('Conditions', ['non_gpu', 'vendors', 'devices']) |
50 | 50 |
51 class WebGLConformanceExpectationsTest(unittest.TestCase): | 51 class WebGLConformanceExpectationsTest(unittest.TestCase): |
52 def testGlslConstructVecMatIndexExpectationOnWin(self): | 52 def testGlslConstructVecMatIndexExpectationOnWin(self): |
53 possible_browser = fakes.FakePossibleBrowser() | 53 possible_browser = fakes.FakePossibleBrowser() |
54 browser = possible_browser.Create(None) | 54 browser = possible_browser.Create(None) |
55 browser.platform = FakeWindowsPlatform() | 55 browser.platform = FakeWindowsPlatform() |
56 browser.returned_system_info = fakes.FakeSystemInfo( | 56 browser.returned_system_info = fakes.FakeSystemInfo( |
57 gpu_dict=fake_win_amd_gpu_info.FAKE_GPU_INFO) | 57 gpu_dict=fake_win_amd_gpu_info.FAKE_GPU_INFO) |
58 expectations = webgl_conformance_expectations.\ | 58 expectations = webgl_conformance_expectations.\ |
59 WebGLConformanceExpectations( | 59 WebGLConformanceExpectations( |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 len(c1.vendors.intersection(c2.vendors)) != 0 or \ | 138 len(c1.vendors.intersection(c2.vendors)) != 0 or \ |
139 len(c1.devices.intersection(c2.devices)) != 0 or \ | 139 len(c1.devices.intersection(c2.devices)) != 0 or \ |
140 any([vendor in c1.vendors for (vendor, _) in c2.devices]) or \ | 140 any([vendor in c1.vendors for (vendor, _) in c2.devices]) or \ |
141 any([vendor in c2.vendors for (vendor, _) in c1.devices]) | 141 any([vendor in c2.vendors for (vendor, _) in c1.devices]) |
142 | 142 |
143 conflicts = non_gpu_conflicts and gpu_conflicts | 143 conflicts = non_gpu_conflicts and gpu_conflicts |
144 | 144 |
145 if conflicts: | 145 if conflicts: |
146 print "WARNING: Found a conflict for", pattern | 146 print "WARNING: Found a conflict for", pattern |
147 self.assertEquals(conflicts, False) | 147 self.assertEquals(conflicts, False) |
OLD | NEW |