Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: content/test/gpu/gpu_tests/gpu_test_base_unittest.py

Issue 1413883003: Add a presubmit script and pylintrc for content/test/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address kbr's comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 os
5 import unittest 4 import unittest
6 5
7 from telemetry import benchmark 6 from telemetry import benchmark as benchmark_module
8 from telemetry.core import exceptions 7 from telemetry.core import exceptions
9 from telemetry.core import util
10 from telemetry.story import story_set as story_set_module 8 from telemetry.story import story_set as story_set_module
11 from telemetry.testing import fakes 9 from telemetry.testing import fakes
12 10
13 import mock # pylint: disable=import-error 11 import mock # pylint: disable=import-error
14 12
15 import gpu_test_base 13 from gpu_tests import gpu_test_base
16 14
17 # Unit tests verifying invariants of classes in GpuTestBase. 15 # Unit tests verifying invariants of classes in GpuTestBase.
18 16
19 # 17 #
20 # Tests verifying interactions between Telemetry and GpuTestBase. 18 # Tests verifying interactions between Telemetry and GpuTestBase.
21 # 19 #
22 20
23 class FakeValidator(gpu_test_base.ValidatorBase): 21 class FakeValidator(gpu_test_base.ValidatorBase):
24 def __init__(self, manager_mock=None): 22 def __init__(self, manager_mock=None):
25 super(FakeValidator, self).__init__() 23 super(FakeValidator, self).__init__()
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 def setupTest(self, num_test_failures=0, manager_mock=None): 154 def setupTest(self, num_test_failures=0, manager_mock=None):
157 finder_options = fakes.CreateBrowserFinderOptions() 155 finder_options = fakes.CreateBrowserFinderOptions()
158 finder_options.browser_options.platform = fakes.FakeLinuxPlatform() 156 finder_options.browser_options.platform = fakes.FakeLinuxPlatform()
159 finder_options.output_formats = ['none'] 157 finder_options.output_formats = ['none']
160 finder_options.suppress_gtest_report = True 158 finder_options.suppress_gtest_report = True
161 finder_options.output_dir = None 159 finder_options.output_dir = None
162 finder_options.upload_bucket = 'public' 160 finder_options.upload_bucket = 'public'
163 finder_options.upload_results = False 161 finder_options.upload_results = False
164 testclass = FakeTest 162 testclass = FakeTest
165 parser = finder_options.CreateParser() 163 parser = finder_options.CreateParser()
166 benchmark.AddCommandLineArgs(parser) 164 benchmark_module.AddCommandLineArgs(parser)
167 testclass.AddCommandLineArgs(parser) 165 testclass.AddCommandLineArgs(parser)
168 options, dummy_args = parser.parse_args([]) 166 options, dummy_args = parser.parse_args([])
169 benchmark.ProcessCommandLineArgs(parser, options) 167 benchmark_module.ProcessCommandLineArgs(parser, options)
170 testclass.ProcessCommandLineArgs(parser, options) 168 testclass.ProcessCommandLineArgs(parser, options)
171 test = testclass(times_to_fail_test=num_test_failures, 169 test = testclass(times_to_fail_test=num_test_failures,
172 manager_mock=manager_mock) 170 manager_mock=manager_mock)
173 return test, finder_options 171 return test, finder_options
174 172
175 # Test page.Run() method is called by telemetry framework before 173 # Test page.Run() method is called by telemetry framework before
176 # ValidateAndMeasurePage. 174 # ValidateAndMeasurePage.
177 def testPageRunMethodIsCalledBeforeValidateAndMeasurePage(self): 175 def testPageRunMethodIsCalledBeforeValidateAndMeasurePage(self):
178 manager = mock.Mock() 176 manager = mock.Mock()
179 test, finder_options = self.setupTest(manager_mock=manager) 177 test, finder_options = self.setupTest(manager_mock=manager)
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 mock.call.page2.RunNavigateSteps(mock.ANY), 397 mock.call.page2.RunNavigateSteps(mock.ANY),
400 mock.call.validator.WillNavigateToPage( 398 mock.call.validator.WillNavigateToPage(
401 page2, mock.ANY), 399 page2, mock.ANY),
402 mock.call.page2.RunNavigateSteps(mock.ANY), 400 mock.call.page2.RunNavigateSteps(mock.ANY),
403 mock.call.validator.DidNavigateToPage( 401 mock.call.validator.DidNavigateToPage(
404 page2, mock.ANY), 402 page2, mock.ANY),
405 mock.call.page2.RunPageInteractions(mock.ANY), 403 mock.call.page2.RunPageInteractions(mock.ANY),
406 mock.call.validator.ValidateAndMeasurePage( 404 mock.call.validator.ValidateAndMeasurePage(
407 page2, mock.ANY, mock.ANY)] 405 page2, mock.ANY, mock.ANY)]
408 self.assertTrue(manager.mock_calls == expected) 406 self.assertTrue(manager.mock_calls == expected)
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/gpu_test_base.py ('k') | content/test/gpu/gpu_tests/gpu_test_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698