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

Side by Side Diff: telemetry/examples/browser_tests/process_tests.py

Issue 2700563004: [Telemetry] Migrate browser_test_runner to use typ as the test runner (Closed)
Patch Set: Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2017 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 4
5 import sys 5 import sys
6 6
7 from telemetry.testing import serially_executed_browser_test_case 7 from telemetry.testing import serially_executed_browser_test_case
8 8
9 9
10 class SetUpClassFailedTest( 10 class FailIfSetUpProcessCalledTwice(
11 serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase): 11 serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase):
12 count = 0
12 13
13 @classmethod 14 @classmethod
14 def setUpClass(cls): 15 def SetUpProcess(cls):
15 raise Exception 16 cls.count += 1
17 if cls.count >= 2:
18 assert False, 'This should not be called more than once'
16 19
17 @classmethod 20 @classmethod
18 def GenerateTestCases_DummyTest(cls, options): 21 def GenerateTestCases_DummyTest(cls, options):
19 del options # Unused. 22 del options # Unused.
20 for i in xrange(0, 100): 23 for i in xrange(0, 3):
21 yield 'dummy_test_%i' % i, () 24 yield 'Dummy_%i' % i, ()
22 25
23 def DummyTest(self): 26 def DummyTest(self):
24 pass 27 pass
25 28
26 29
27 class TearDownClassFailedTest( 30 class FailIfTearDownProcessCalledTwice(
28 serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase): 31 serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase):
32 count = 0
29 33
30 @classmethod 34 @classmethod
31 def tearDownClass(cls): 35 def TearDownProcess(cls):
32 raise Exception 36 cls.count += 1
37 if cls.count >= 2:
38 assert False, 'This should not be called more than once'
33 39
34 @classmethod 40 @classmethod
35 def GenerateTestCases_DummyTest(cls, options): 41 def GenerateTestCases_DummyTest(cls, options):
36 del options # Unused. 42 del options # Unused.
37 for i in xrange(0, 100): 43 for i in xrange(0, 3):
38 yield 'dummy_test_%i' % i, () 44 yield 'Dummy_%i' % i, ()
39 45
40 def DummyTest(self): 46 def DummyTest(self):
41 pass 47 pass
42 48
43 49
44 def load_tests(loader, tests, pattern): 50 def load_tests(loader, tests, pattern):
45 del loader, tests, pattern # Unused. 51 del loader, tests, pattern # Unused.
46 return serially_executed_browser_test_case.LoadAllTestsInModule( 52 return serially_executed_browser_test_case.LoadAllTestsInModule(
47 sys.modules[__name__]) 53 sys.modules[__name__])
OLDNEW
« no previous file with comments | « telemetry/examples/browser_tests/failed_tests.py ('k') | telemetry/examples/browser_tests/sample_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698