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

Unified Diff: mojo/public/interfaces/bindings/tests/test_structs.mojom

Issue 628763002: Mojo JS bindings: simplify mojo.connectToService() usage - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored scoped enums and constants, moved interface def 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
Index: mojo/public/interfaces/bindings/tests/test_structs.mojom
diff --git a/mojo/public/interfaces/bindings/tests/test_structs.mojom b/mojo/public/interfaces/bindings/tests/test_structs.mojom
index d361da775322354514d24cc99956ca89f3c891ce..6af00866fec053dbc001cc1572a839ca01d6e611 100644
--- a/mojo/public/interfaces/bindings/tests/test_structs.mojom
+++ b/mojo/public/interfaces/bindings/tests/test_structs.mojom
@@ -82,4 +82,30 @@ struct DefaultFieldValues {
Rect? f16 = default;
};
+
+// Used to verify that the code generated for enum and const values defined
+// within a struct is correct. Assuming that a constant's value can be a literal
+// or another constant and that enum values can either be an integer constant or
+// another value from the same enum type.
+
+struct ScopedConstants {
+ const int32 TEN = 10;
+ const int32 ALSO_TEN = TEN;
+ enum EType {
+ E0,
+ E1,
+ E2 = 10,
+ E3 = E2,
+ E4,
+ };
+ const int32 TEN_TOO = EType.E2;
+ EType f0 = E0; // 0
+ EType f1 = E1; // 1
+ EType f2 = E2; // 10
+ EType f3 = E3; // 10
+ EType f4 = E4; // 11
+ int32 f5 = TEN;
+ int32 f6 = ALSO_TEN;
+};
+
}

Powered by Google App Engine
This is Rietveld 408576698