| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Unittests for reraiser_thread.py.""" | 5 """Unittests for reraiser_thread.py.""" |
| 6 | 6 |
| 7 import threading | 7 import threading |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 import reraiser_thread | 10 from pylib.utils import reraiser_thread |
| 11 import watchdog_timer | 11 from pylib.utils import watchdog_timer |
| 12 | 12 |
| 13 | 13 |
| 14 class TestException(Exception): | 14 class TestException(Exception): |
| 15 pass | 15 pass |
| 16 | 16 |
| 17 | 17 |
| 18 class TestReraiserThread(unittest.TestCase): | 18 class TestReraiserThread(unittest.TestCase): |
| 19 """Tests for reraiser_thread.ReraiserThread.""" | 19 """Tests for reraiser_thread.ReraiserThread.""" |
| 20 def testNominal(self): | 20 def testNominal(self): |
| 21 result = [None, None] | 21 result = [None, None] |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 [reraiser_thread.ReraiserThread(g), | 87 [reraiser_thread.ReraiserThread(g), |
| 88 reraiser_thread.ReraiserThread(f)]) | 88 reraiser_thread.ReraiserThread(f)]) |
| 89 group.StartAll() | 89 group.StartAll() |
| 90 with self.assertRaises(reraiser_thread.TimeoutError): | 90 with self.assertRaises(reraiser_thread.TimeoutError): |
| 91 group.JoinAll(watchdog_timer.WatchdogTimer(0.01)) | 91 group.JoinAll(watchdog_timer.WatchdogTimer(0.01)) |
| 92 event.set() | 92 event.set() |
| 93 | 93 |
| 94 | 94 |
| 95 if __name__ == '__main__': | 95 if __name__ == '__main__': |
| 96 unittest.main() | 96 unittest.main() |
| OLD | NEW |