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

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

Issue 622593002: mojo: Allow circular dependencies between structs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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
Index: mojo/python/tests/bindings_structs_unittest.py
diff --git a/mojo/python/tests/bindings_structs_unittest.py b/mojo/python/tests/bindings_structs_unittest.py
index f7746acd763158c1365942697bc46d8e59c04862..f03ca2637dae642a3fbfa730e43fd0cea59aa32c 100644
--- a/mojo/python/tests/bindings_structs_unittest.py
+++ b/mojo/python/tests/bindings_structs_unittest.py
@@ -10,6 +10,7 @@ import mojo.system
# Generated files
# pylint: disable=F0401
+import regression_tests_mojom
import sample_import_mojom
import sample_import2_mojom
import sample_service_mojom
@@ -179,3 +180,10 @@ class StructBindingsTest(unittest.TestCase):
self.assertEquals(foo_instance.a, False)
self.assertEquals(foo_instance.bar, bar_instance)
+ def testCyclicDefinition(self):
+ a = regression_tests_mojom.A()
+ b = regression_tests_mojom.B()
+ self.assertIsNone(a.b)
+ self.assertIsNone(b.a)
+ a.b = b
+ self.assertIs(a.b, b)

Powered by Google App Engine
This is Rietveld 408576698