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

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

Issue 1413033011: Fix bug whereby booleans in unions could not be serialized in python. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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/tools/bindings/generators/mojom_python_generator.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/bindings_unions_unittest.py
diff --git a/mojo/python/tests/bindings_unions_unittest.py b/mojo/python/tests/bindings_unions_unittest.py
index b1d742fd551c2395e889a2fe7e8a3cfec6d4d350..8fa6ebda242cab888e0e9ef28d34c6cf85bea625 100644
--- a/mojo/python/tests/bindings_unions_unittest.py
+++ b/mojo/python/tests/bindings_unions_unittest.py
@@ -101,6 +101,15 @@ class UnionBindingsTest(unittest.TestCase):
with self.assertRaises(serialization.SerializationException):
u.Serialize()
+ def testBoolInUnionSerialization(self):
+ u = test_unions_mojom.PodUnion(f_bool=True)
+ data, handles = u.Serialize()
+
+ context = serialization.RootDeserializationContext(data, handles)
+ decoded = test_unions_mojom.PodUnion.Deserialize(context)
+
+ self.assertEquals(u, decoded)
+
def testArrayInUnionSerialization(self):
u = test_unions_mojom.ObjectUnion(
f_array_int8=[1, 2, 3, 4, 5])
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_python_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698