| 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 unittest | 5 import unittest |
| 6 | 6 |
| 7 import mojo_unittest | 7 import mojo_unittest |
| 8 from mojo.bindings import messaging | 8 from mojo_bindings import messaging |
| 9 | 9 |
| 10 # pylint: disable=E0611 | 10 # pylint: disable=E0611 |
| 11 from mojo import system | 11 import mojo_system as system |
| 12 | 12 |
| 13 | 13 |
| 14 class _ForwardingConnectionErrorHandler(messaging.ConnectionErrorHandler): | 14 class _ForwardingConnectionErrorHandler(messaging.ConnectionErrorHandler): |
| 15 | 15 |
| 16 def __init__(self, callback): | 16 def __init__(self, callback): |
| 17 messaging.ConnectionErrorHandler.__init__(self) | 17 messaging.ConnectionErrorHandler.__init__(self) |
| 18 self._callback = callback | 18 self._callback = callback |
| 19 | 19 |
| 20 def OnError(self, result): | 20 def OnError(self, result): |
| 21 self._callback(result) | 21 self._callback(result) |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 self.assertNotEquals(message_header.request_id, 0) | 208 self.assertNotEquals(message_header.request_id, 0) |
| 209 response_header_data = messaging.MessageHeader( | 209 response_header_data = messaging.MessageHeader( |
| 210 0, | 210 0, |
| 211 messaging.MESSAGE_IS_RESPONSE_FLAG, | 211 messaging.MESSAGE_IS_RESPONSE_FLAG, |
| 212 message_header.request_id).Serialize() | 212 message_header.request_id).Serialize() |
| 213 self.handle.WriteMessage(response_header_data) | 213 self.handle.WriteMessage(response_header_data) |
| 214 self.loop.RunUntilIdle() | 214 self.loop.RunUntilIdle() |
| 215 self.assertFalse(self.received_errors) | 215 self.assertFalse(self.received_errors) |
| 216 self.assertEquals(len(back_messages), 1) | 216 self.assertEquals(len(back_messages), 1) |
| 217 self.assertEquals(back_messages[0].data, response_header_data) | 217 self.assertEquals(back_messages[0].data, response_header_data) |
| OLD | NEW |