| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 5 |
| 6 class TestRun(object): | 6 class TestRun(object): |
| 7 """An execution of a particular test on a particular device. | 7 """An execution of a particular test on a particular device. |
| 8 | 8 |
| 9 This is expected to handle all logic that is specific to the combination of | 9 This is expected to handle all logic that is specific to the combination of |
| 10 environment and test type. | 10 environment and test type. |
| 11 | 11 |
| 12 Examples include: | 12 Examples include: |
| 13 - local gtests | 13 - local gtests |
| 14 - local instrumentation tests | 14 - local instrumentation tests |
| 15 """ | 15 """ |
| 16 | 16 |
| 17 def __init__(self, env, test_instance): | 17 def __init__(self, env, test_instance): |
| 18 self._env = env | 18 self._env = env |
| 19 self._test_instance = test_instance | 19 self._test_instance = test_instance |
| 20 | 20 |
| 21 def TestPackage(self): | 21 def TestPackage(self): |
| 22 raise NotImplementedError | 22 raise NotImplementedError |
| 23 | 23 |
| 24 def SetUp(self): | 24 def SetUp(self): |
| 25 raise NotImplementedError | 25 raise NotImplementedError |
| 26 | 26 |
| 27 def RunTest(self): | 27 def RunTests(self): |
| 28 raise NotImplementedError | 28 raise NotImplementedError |
| 29 | 29 |
| 30 def TearDown(self): | 30 def TearDown(self): |
| 31 raise NotImplementedError | 31 raise NotImplementedError |
| 32 | 32 |
| 33 def __enter__(self): | 33 def __enter__(self): |
| 34 self.SetUp() | 34 self.SetUp() |
| 35 return self | 35 return self |
| 36 | 36 |
| 37 def __exit__(self, exc_type, exc_val, exc_tb): | 37 def __exit__(self, exc_type, exc_val, exc_tb): |
| 38 self.TearDown() | 38 self.TearDown() |
| 39 | 39 |
| OLD | NEW |