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

Side by Side Diff: mojo/public/interfaces/bindings/tests/struct_with_traits.mojom

Issue 2965663002: Mojo C++ bindings: support setting default value for fields whose types are typemapped enums. (Closed)
Patch Set: . Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module mojo.test; 5 module mojo.test;
6 6
7 // TODO(yzshen): Rename *WithTraits* types to something more readable. 7 // TODO(yzshen): Rename *WithTraits* types to something more readable.
8 8
9 struct NestedStructWithTraits { 9 struct NestedStructWithTraits {
10 int32 value; 10 int32 value;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 EchoEnumWithTraits(EnumWithTraits e) => (EnumWithTraits passed); 74 EchoEnumWithTraits(EnumWithTraits e) => (EnumWithTraits passed);
75 75
76 EchoStructWithTraitsForUniquePtr(StructWithTraitsForUniquePtr e) => ( 76 EchoStructWithTraitsForUniquePtr(StructWithTraitsForUniquePtr e) => (
77 StructWithTraitsForUniquePtr passed); 77 StructWithTraitsForUniquePtr passed);
78 78
79 EchoNullableStructWithTraitsForUniquePtr(StructWithTraitsForUniquePtr? e) => ( 79 EchoNullableStructWithTraitsForUniquePtr(StructWithTraitsForUniquePtr? e) => (
80 StructWithTraitsForUniquePtr? passed); 80 StructWithTraitsForUniquePtr? passed);
81 81
82 EchoUnionWithTraits(UnionWithTraits u) => (UnionWithTraits passed); 82 EchoUnionWithTraits(UnionWithTraits u) => (UnionWithTraits passed);
83 }; 83 };
84
85 // Test that specifying default value for a typemapped enum field works.
86 struct EnumWithTraitsContainer {
87 EnumWithTraits f_field = EnumWithTraits.VALUE_1;
88 };
89
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/struct_traits_unittest.cc ('k') | mojo/public/tools/bindings/generators/mojom_cpp_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698