OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import unittest | 4 import unittest |
5 | 5 |
6 from telemetry import util | 6 from telemetry import util |
7 | 7 |
8 class TestWait(unittest.TestCase): | 8 class TestWait(unittest.TestCase): |
9 @staticmethod | 9 @staticmethod |
10 def testNonTimeout(): | 10 def testNonTimeout(): |
11 def test(): | 11 def test(): |
12 return True | 12 return True |
13 util.WaitFor(test, 0.1) | 13 util.WaitFor(test, 0.1) |
14 | 14 |
15 def testTimeout(self): | 15 def testTimeout(self): |
16 def test(): | 16 def test(): |
17 return False | 17 return False |
18 self.assertRaises(util.TimeoutException, lambda: util.WaitFor(test, 0.1)) | 18 self.assertRaises(util.TimeoutException, lambda: util.WaitFor(test, 0.1)) |
OLD | NEW |