OLD | NEW |
---|---|
(Empty) | |
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 | |
3 # found in the LICENSE file. | |
4 import os | |
5 import unittest | |
6 | |
7 from telemetry.core import util | |
8 from telemetry.testing import fakes | |
9 | |
10 import fake_win_amd_gpu_info | |
11 import gpu_test_base | |
12 import webgl_conformance_expectations | |
13 | |
14 import pdb | |
nednguyen
2015/09/22 20:16:54
style nit: unused import.
Tip: in telemetry, we h
Ken Russell (switch to Gerrit)
2015/09/22 20:37:01
Thanks. Fixed.
| |
15 | |
16 class FakeWindowsPlatform(fakes.FakePlatform): | |
17 @property | |
18 def is_host_platform(self): | |
19 return True | |
20 | |
21 def GetDeviceTypeName(self): | |
22 return 'Desktop' | |
23 | |
24 def GetArchName(self): | |
25 return 'x86_64' | |
26 | |
27 def GetOSName(self): | |
28 return 'win' | |
29 | |
30 def GetOSVersionName(self): | |
31 return 'win8' | |
32 | |
33 | |
34 class FakePage(gpu_test_base.PageBase): | |
35 def __init__(self, url, expectations): | |
36 super(FakePage, self).__init__( | |
37 name=('WebglConformance.%s' % | |
38 url.replace('/', '_').replace('-', '_'). | |
39 replace('\\', '_').rpartition('.')[0].replace('.', '_')), | |
40 url='file://' + url, | |
41 page_set=None, | |
42 shared_page_state_class=gpu_test_base.FakeGpuSharedPageState, | |
43 expectations=expectations) | |
44 | |
45 class WebGLConformanceExpectationsTest(unittest.TestCase): | |
46 def testGlslConstructVecMatIndexExpectationOnWin(self): | |
47 possible_browser = fakes.FakePossibleBrowser() | |
48 browser = possible_browser.Create(None) | |
49 browser.platform = FakeWindowsPlatform() | |
50 browser.returned_system_info = fakes.FakeSystemInfo( | |
51 gpu_dict=fake_win_amd_gpu_info.FAKE_GPU_INFO) | |
52 expectations = webgl_conformance_expectations.\ | |
53 WebGLConformanceExpectations( | |
54 os.path.join( | |
55 util.GetChromiumSrcDir(), | |
56 'third_party', 'webgl', 'src', 'sdk', 'tests')) | |
57 page = FakePage( | |
58 'conformance/glsl/constructors/glsl-construct-vec-mat-index.html', | |
59 expectations) | |
60 expectation = expectations.GetExpectationForPage(browser, page) | |
61 # TODO(kbr): change this expectation back to "flaky". crbug.com/534697 | |
62 self.assertEquals(expectation, 'fail') | |
OLD | NEW |