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 gpu_test_base |
| 11 import webgl_conformance_expectations |
| 12 |
| 13 import pdb |
| 14 |
| 15 class FakeWindowsPlatform(fakes.FakePlatform): |
| 16 @property |
| 17 def is_host_platform(self): |
| 18 return True |
| 19 |
| 20 def GetDeviceTypeName(self): |
| 21 return 'Desktop' |
| 22 |
| 23 def GetArchName(self): |
| 24 return 'x86_64' |
| 25 |
| 26 def GetOSName(self): |
| 27 return 'win' |
| 28 |
| 29 def GetOSVersionName(self): |
| 30 return 'win8' |
| 31 |
| 32 |
| 33 class FakePage(gpu_test_base.PageBase): |
| 34 def __init__(self, url, expectations): |
| 35 super(FakePage, self).__init__( |
| 36 name=('WebglConformance.%s' % |
| 37 url.replace('/', '_').replace('-', '_'). |
| 38 replace('\\', '_').rpartition('.')[0].replace('.', '_')), |
| 39 url='file://' + url, |
| 40 page_set=None, |
| 41 shared_page_state_class=gpu_test_base.FakeGpuSharedPageState, |
| 42 expectations=expectations) |
| 43 |
| 44 class WebGLConformanceExpectationsTest(unittest.TestCase): |
| 45 def testGlslConstructVecMatIndexExpectationOnWin(self): |
| 46 possible_browser = fakes.FakePossibleBrowser() |
| 47 browser = possible_browser.Create(None) |
| 48 browser.platform = FakeWindowsPlatform() |
| 49 gpu_device = browser.returned_system_info._gpu._devices[0] |
| 50 gpu_device._vendor_id = 0x1002 |
| 51 gpu_device._device_id = 0x6779 |
| 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 |