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

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: Rebase Created 6 years, 2 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
« 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_structs_unittest.py
diff --git a/mojo/python/tests/bindings_structs_unittest.py b/mojo/python/tests/bindings_structs_unittest.py
index 97c12450f7200c1bcea70e041d4b169a85d47bbd..f47cac56fcb8163edcf04c4964bc0312c0903032 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
@@ -206,3 +207,11 @@ class StructBindingsTest(unittest.TestCase):
p = sample_import_mojom.Point(0, x=0)
with self.assertRaises(TypeError):
p = sample_import_mojom.Point(c=0)
+
+ 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)
« 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