OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 import "mojo/public/interfaces/bindings/tests/rect.mojom" | 5 import "mojo/public/interfaces/bindings/tests/rect.mojom" |
6 | 6 |
7 [JavaPackage="org.chromium.mojo.bindings.test.mojom.test_structs"] | 7 [JavaPackage="org.chromium.mojo.bindings.test.mojom.test_structs"] |
8 module mojo.test { | 8 module mojo.test { |
9 | 9 |
10 struct NamedRegion { | 10 struct NamedRegion { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 float f9 = 100; | 75 float f9 = 100; |
76 float f10 = 100.0; | 76 float f10 = 100.0; |
77 double f11 = 100; | 77 double f11 = 100; |
78 double f12 = 100.0; | 78 double f12 = 100.0; |
79 string f13 = kFoo; | 79 string f13 = kFoo; |
80 string? f14 = kFoo; | 80 string? f14 = kFoo; |
81 Rect f15 = default; | 81 Rect f15 = default; |
82 Rect? f16 = default; | 82 Rect? f16 = default; |
83 }; | 83 }; |
84 | 84 |
| 85 |
| 86 // Used to verify that the code generated for enum and const values defined |
| 87 // within a struct is correct. Assuming that a constant's value can be a literal |
| 88 // or another constant and that enum values can either be an integer constant or |
| 89 // another value from the same enum type. |
| 90 |
| 91 struct ScopedConstants { |
| 92 const int32 TEN = 10; |
| 93 const int32 ALSO_TEN = TEN; |
| 94 enum EType { |
| 95 E0, |
| 96 E1, |
| 97 E2 = 10, |
| 98 E3 = E2, |
| 99 E4, |
| 100 }; |
| 101 const int32 TEN_TOO = EType.E2; |
| 102 EType f0 = E0; // 0 |
| 103 EType f1 = E1; // 1 |
| 104 EType f2 = E2; // 10 |
| 105 EType f3 = E3; // 10 |
| 106 EType f4 = E4; // 11 |
| 107 int32 f5 = TEN; |
| 108 int32 f6 = ALSO_TEN; |
| 109 }; |
| 110 |
85 } | 111 } |
OLD | NEW |