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

Unified Diff: mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py

Issue 1522583003: New Mojom compiler: Assign a meaningful spec string instead of 'dummyspec' because it turns out it… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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/tools/bindings/pylib/mojom/generate/mojom_translator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py
index 57196e95cb42a916946162dac3f4e72229042d96..ca4696c7410423251baff985c4a9c30082da83a3 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py
@@ -77,6 +77,7 @@ class TestTranslateFile(unittest.TestCase):
fields=[],
decl_data=mojom_types_mojom.DeclarationData(
short_name='AStruct',
+ full_identifier='foo.AStruct',
source_file_info=mojom_types_mojom.SourceFileInfo(
file_name=file_name)))
graph.resolved_types['struct_key'] = mojom_types_mojom.UserDefinedType(
@@ -138,8 +139,17 @@ class TestTranslateFile(unittest.TestCase):
self.assertIn(second_level_imported_file_name, transitive_imports_paths)
self.assertEquals(mojom_interface.interface_name, mod.interfaces[0].name)
+ # Interfaces should be assigned their name as their spec.
+ self.assertEquals('AnInterface', mod.interfaces[0].spec)
self.assertEquals(mojom_struct.decl_data.short_name, mod.structs[0].name)
+ # The struct was given a full_identifier so its spec should be that.
+ self.assertEquals(mojom_struct.decl_data.full_identifier,
+ mod.structs[0].spec)
self.assertEquals(mojom_union.decl_data.short_name, mod.unions[0].name)
+ # The union was given a short name but not a full_identifier so its spec
+ # should be the short name.
+ self.assertEquals(mojom_union.decl_data.short_name,
+ mod.unions[0].spec)
self.assertEquals(mojom_enum.decl_data.short_name, mod.enums[0].name)
self.assertEquals(mojom_const.decl_data.short_name, mod.constants[0].name)
« no previous file with comments | « mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698