Chromium Code Reviews| Index: build/android/pylib/utils/reraiser_thread_unittest.py |
| diff --git a/build/android/pylib/utils/reraiser_thread_unittest.py b/build/android/pylib/utils/reraiser_thread_unittest.py |
| index 9228829fa23e25c98cb683d635d37ac36a547473..f82be508ba1f4723f14496fbf335733dad1c7a80 100644 |
| --- a/build/android/pylib/utils/reraiser_thread_unittest.py |
| +++ b/build/android/pylib/utils/reraiser_thread_unittest.py |
| @@ -4,9 +4,11 @@ |
| """Unittests for reraiser_thread.py.""" |
| +import threading |
| import unittest |
| import reraiser_thread |
| +import watchdog |
| class TestException(Exception): |
| @@ -75,6 +77,20 @@ class TestReraiserThreadGroup(unittest.TestCase): |
| with self.assertRaises(TestException): |
| group.JoinAll() |
| + def testJoinTimeout(self): |
| + def f(): |
| + pass |
| + event = threading.Event() |
| + def g(): |
| + event.wait() |
| + group = reraiser_thread.ReraiserThreadGroup( |
| + [reraiser_thread.ReraiserThread(g), |
| + reraiser_thread.ReraiserThread(f)]) |
| + group.StartAll() |
| + with self.assertRaises(reraiser_thread.TimeoutError): |
| + group.JoinAll(watchdog.Watchdog(0)) |
|
frankf
2013/04/03 20:49:52
Might want test a positive timeout value as well
craigdh
2013/04/03 21:17:47
The other tests call JoinAll with no arguments whi
|
| + event.set() |
| + |
| if __name__ == '__main__': |
| unittest.main() |