OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 string | 5 import string |
6 import time | 6 import time |
7 | 7 |
8 from telemetry.testing import serially_executed_browser_test_case | 8 from telemetry.testing import serially_executed_browser_test_case |
9 | 9 |
10 | 10 |
11 _prev_test_name = None | 11 _prev_test_name = None |
12 | 12 |
13 class SimpleTest(serially_executed_browser_test_case.SeriallyBrowserTestCase): | 13 class SimpleTest( |
| 14 serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase): |
14 | 15 |
15 @classmethod | 16 @classmethod |
16 def AddCommandlineArgs(cls, parser): | 17 def AddCommandlineArgs(cls, parser): |
17 parser.add_option('--adder-sum', type=int, default=5) | 18 parser.add_option('--adder-sum', type=int, default=5) |
18 | 19 |
19 def setUp(self): | 20 def setUp(self): |
20 self.extra = 5 | 21 self.extra = 5 |
21 | 22 |
22 @classmethod | 23 @classmethod |
23 def GenerateTestCases_AdderTest(cls, options): | 24 def GenerateTestCases_AdderTest(cls, options): |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 66 |
66 def MultiplierTest(self, a, b, partial_sum): | 67 def MultiplierTest(self, a, b, partial_sum): |
67 self.assertEqual(a * b, partial_sum * self.extra) | 68 self.assertEqual(a * b, partial_sum * self.extra) |
68 | 69 |
69 def TestSimple(self): | 70 def TestSimple(self): |
70 time.sleep(0.5) | 71 time.sleep(0.5) |
71 self.assertEqual(1, self.extra) | 72 self.assertEqual(1, self.extra) |
72 | 73 |
73 def TestException(self): | 74 def TestException(self): |
74 raise Exception('Expected exception') | 75 raise Exception('Expected exception') |
OLD | NEW |