| 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 class AsyncWaitTest(mojo_unittest.MojoTestCase): | 11 class AsyncWaitTest(mojo_unittest.MojoTestCase): |
| 12 | 12 |
| 13 def setUp(self): | 13 def setUp(self): |
| 14 super(AsyncWaitTest, self).setUp() | 14 super(AsyncWaitTest, self).setUp() |
| 15 self.array = [] | 15 self.array = [] |
| 16 self.handles = system.MessagePipe() | 16 self.handles = system.MessagePipe() |
| 17 self.cancel = self.handles.handle0.AsyncWait(system.HANDLE_SIGNAL_READABLE, | 17 self.cancel = self.handles.handle0.AsyncWait(system.HANDLE_SIGNAL_READABLE, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 def testAsyncWaitCancel(self): | 42 def testAsyncWaitCancel(self): |
| 43 self.loop.PostDelayedTask(self.cancel, 0) | 43 self.loop.PostDelayedTask(self.cancel, 0) |
| 44 self._PostWriteAndRun() | 44 self._PostWriteAndRun() |
| 45 self.assertEquals(len(self.array), 0) | 45 self.assertEquals(len(self.array), 0) |
| 46 | 46 |
| 47 def testAsyncWaitImmediateCancel(self): | 47 def testAsyncWaitImmediateCancel(self): |
| 48 self.cancel() | 48 self.cancel() |
| 49 self._PostWriteAndRun() | 49 self._PostWriteAndRun() |
| 50 self.assertEquals(len(self.array), 0) | 50 self.assertEquals(len(self.array), 0) |
| OLD | NEW |