Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 // The custom type for MoveOnlyStructWithTraits is not clonable. Test that | 46 // The custom type for MoveOnlyStructWithTraits is not clonable. Test that |
| 47 // this container can compile as long as Clone() is not used. | 47 // this container can compile as long as Clone() is not used. |
| 48 struct MoveOnlyStructWithTraitsContainer { | 48 struct MoveOnlyStructWithTraitsContainer { |
| 49 MoveOnlyStructWithTraits f_struct; | 49 MoveOnlyStructWithTraits f_struct; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 struct StructWithTraitsForUniquePtr { | 52 struct StructWithTraitsForUniquePtr { |
| 53 int32 f_int32; | 53 int32 f_int32; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 union UnionWithTraits { | |
| 57 int32 f_int32; | |
| 58 NestedStructWithTraits f_struct; | |
| 59 }; | |
| 60 | |
| 56 interface TraitsTestService { | 61 interface TraitsTestService { |
| 57 EchoStructWithTraits(StructWithTraits s) => (StructWithTraits passed); | 62 EchoStructWithTraits(StructWithTraits s) => (StructWithTraits passed); |
| 58 | 63 |
| 59 EchoTrivialStructWithTraits(TrivialStructWithTraits s) => | 64 EchoTrivialStructWithTraits(TrivialStructWithTraits s) => |
| 60 (TrivialStructWithTraits passed); | 65 (TrivialStructWithTraits passed); |
| 61 | 66 |
| 62 EchoMoveOnlyStructWithTraits(MoveOnlyStructWithTraits s) => | 67 EchoMoveOnlyStructWithTraits(MoveOnlyStructWithTraits s) => |
| 63 (MoveOnlyStructWithTraits passed); | 68 (MoveOnlyStructWithTraits passed); |
| 64 | 69 |
| 65 EchoNullableMoveOnlyStructWithTraits(MoveOnlyStructWithTraits? s) => | 70 EchoNullableMoveOnlyStructWithTraits(MoveOnlyStructWithTraits? s) => |
| 66 (MoveOnlyStructWithTraits? passed); | 71 (MoveOnlyStructWithTraits? passed); |
| 67 | 72 |
| 68 EchoEnumWithTraits(EnumWithTraits e) => (EnumWithTraits passed); | 73 EchoEnumWithTraits(EnumWithTraits e) => (EnumWithTraits passed); |
| 69 | 74 |
| 70 EchoStructWithTraitsForUniquePtr(StructWithTraitsForUniquePtr e) => ( | 75 EchoStructWithTraitsForUniquePtr(StructWithTraitsForUniquePtr e) => ( |
| 71 StructWithTraitsForUniquePtr passed); | 76 StructWithTraitsForUniquePtr passed); |
| 72 | 77 |
| 73 EchoNullableStructWithTraitsForUniquePtr(StructWithTraitsForUniquePtr? e) => ( | 78 EchoNullableStructWithTraitsForUniquePtr(StructWithTraitsForUniquePtr? e) => ( |
| 74 StructWithTraitsForUniquePtr? passed); | 79 StructWithTraitsForUniquePtr? passed); |
| 80 | |
| 81 EchoUnionWithTraits(UnionWithTraits u) => (UnionWithTraits passed); | |
|
Fady Samuel
2016/08/08 23:02:46
optional nit: I've found tests are a lot more read
yzshen1
2016/08/08 23:07:38
Yeah, that is probably true.
If you don't mind, I
Fady Samuel
2016/08/08 23:09:03
Yea, of course, no problem. lgtm
| |
| 75 }; | 82 }; |
| OLD | NEW |