| 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 import mojo_unittest | 5 import mojo_unittest |
| 6 | 6 |
| 7 # pylint: disable=F0401 | 7 # pylint: disable=E0611 |
| 8 from mojo import system | 8 from mojo import system |
| 9 | 9 |
| 10 | 10 |
| 11 def _Increment(array): | 11 def _Increment(array): |
| 12 def _Closure(): | 12 def _Closure(): |
| 13 array.append(0) | 13 array.append(0) |
| 14 return _Closure | 14 return _Closure |
| 15 | 15 |
| 16 | 16 |
| 17 class RunLoopTest(mojo_unittest.MojoTestCase): | 17 class RunLoopTest(mojo_unittest.MojoTestCase): |
| (...skipping 14 matching lines...) Expand all Loading... |
| 32 with self.assertRaisesRegexp(Exception, '^error$'): | 32 with self.assertRaisesRegexp(Exception, '^error$'): |
| 33 self.loop.Run() | 33 self.loop.Run() |
| 34 self.assertEquals(len(array), 0) | 34 self.assertEquals(len(array), 0) |
| 35 self.loop.RunUntilIdle() | 35 self.loop.RunUntilIdle() |
| 36 self.assertEquals(len(array), 1) | 36 self.assertEquals(len(array), 1) |
| 37 | 37 |
| 38 def testCurrent(self): | 38 def testCurrent(self): |
| 39 self.assertEquals(system.RunLoop.Current(), self.loop) | 39 self.assertEquals(system.RunLoop.Current(), self.loop) |
| 40 self.loop = None | 40 self.loop = None |
| 41 self.assertIsNone(system.RunLoop.Current()) | 41 self.assertIsNone(system.RunLoop.Current()) |
| OLD | NEW |