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

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

Issue 654843005: Mojo JS Bindings: add support for associative arrays (Mojo map type) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected validation for array map values 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 6af00866fec053dbc001cc1572a839ca01d6e611..20631496d153ab813db5eb97084c6e778d547400 100644
--- a/mojo/public/interfaces/bindings/tests/test_structs.mojom
+++ b/mojo/public/interfaces/bindings/tests/test_structs.mojom
@@ -108,4 +108,34 @@ struct ScopedConstants {
int32 f6 = ALSO_TEN;
};
+// Used to verify that all possible Map key field types can be encoded and
+// decoded successfully.
+
+struct MapKeyTypes {
+ map<bool, bool> f0;
+ map<int8, int8> f1;
+ map<uint8, uint8> f2;
+ map<int16, int16> f3;
+ map<uint16, uint16> f4;
+ map<int32, int32> f5;
+ map<uint32, uint32> f6;
+ map<int64, int64> f7;
+ map<uint64, uint64> f8;
+ map<float, float> f9;
+ map<double, double> f10;
+ map<string, string> f11;
+};
+
+// Used to verify that some common or difficult value types can be encoded and
+// decoded successfully.
+
+struct MapValueTypes {
+ map<string, array<string>> f0;
+ map<string, array<string>?> f1;
+ map<string, array<string?>> f2;
+ map<string, array<string, 2>> f3;
+ map<string, array<array<string, 2>?>> f4;
+ map<string, array<array<string, 2>, 1>> f5;
+};
+
}

Powered by Google App Engine
This is Rietveld 408576698