Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / content / test / gpu / gpu_tests / gpu_test_base_unittest.py
blobf80ab48af28b1c0185a2438b298297c831a79592
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
7 from telemetry.core import discover
9 import gpu_test_base
11 def _GetGpuDir(*subdirs):
12 gpu_dir = os.path.dirname(os.path.dirname(__file__))
13 return os.path.join(gpu_dir, *subdirs)
16 # Unit tests verifying invariants of classes in GpuTestBase.
19 class NoOverridesTest(unittest.TestCase):
20 def testValidatorBase(self):
21 all_validators = discover.DiscoverClasses(
22 _GetGpuDir('gpu_tests'), _GetGpuDir(),
23 gpu_test_base.ValidatorBase,
24 index_by_class_name=True).values()
25 self.assertGreater(len(all_validators), 0)
26 for validator in all_validators:
27 self.assertEquals(gpu_test_base.ValidatorBase.ValidateAndMeasurePage,
28 validator.ValidateAndMeasurePage,
29 'Class %s should not override ValidateAndMeasurePage'
30 % validator.__name__)
32 def testPageBase(self):
33 all_pages = discover.DiscoverClasses(
34 _GetGpuDir(), _GetGpuDir(),
35 gpu_test_base.PageBase,
36 index_by_class_name=True).values()
37 self.assertGreater(len(all_pages), 0)
38 for page in all_pages:
39 self.assertEquals(gpu_test_base.PageBase.RunNavigateSteps,
40 page.RunNavigateSteps,
41 'Class %s should not override ValidateAndMeasurePage'
42 % page.__name__)
43 self.assertEquals(gpu_test_base.PageBase.RunPageInteractions,
44 page.RunPageInteractions,
45 'Class %s should not override RunPageInteractions'
46 % page.__name__)