Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: mojo/python/tests/messaging_unittest.py

Issue 739753003: Store handles with data inside Messages when Connector receives messages (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/python/mojo/bindings/messaging.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/python/tests/messaging_unittest.py
diff --git a/mojo/python/tests/messaging_unittest.py b/mojo/python/tests/messaging_unittest.py
index 767ba745f36d901bf0824a9e48aae70daf3a4519..e09532f0c423576fc8b10afa0a38ab73228a9e5a 100644
--- a/mojo/python/tests/messaging_unittest.py
+++ b/mojo/python/tests/messaging_unittest.py
@@ -45,6 +45,8 @@ class ConnectorTest(mojo_unittest.MojoTestCase):
def tearDown(self):
self.connector = None
self.handle = None
+ self.received_messages = []
+ self.received_errors = []
super(ConnectorTest, self).tearDown()
def testConnectorRead(self):
@@ -72,6 +74,14 @@ class ConnectorTest(mojo_unittest.MojoTestCase):
(result, _, _) = self.handle.ReadMessage()
self.assertEquals(result, system.RESULT_FAILED_PRECONDITION)
+ def testConnectorWriteHandle(self):
+ new_handles = system.MessagePipe()
+ self.handle.WriteMessage(None, [new_handles.handle0])
+ self.loop.RunUntilIdle()
+ self.assertTrue(self.received_messages)
+ self.assertTrue(self.received_messages[0].handles)
+ self.assertFalse(self.received_errors)
+
class HeaderTest(unittest.TestCase):
« no previous file with comments | « mojo/public/python/mojo/bindings/messaging.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698