OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" | 8 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 TEST_F(EqualsTest, InterfacePtr) { | 118 TEST_F(EqualsTest, InterfacePtr) { |
119 base::MessageLoop message_loop; | 119 base::MessageLoop message_loop; |
120 | 120 |
121 SomeInterfacePtr inf1; | 121 SomeInterfacePtr inf1; |
122 SomeInterfacePtr inf2; | 122 SomeInterfacePtr inf2; |
123 | 123 |
124 EXPECT_TRUE(inf1.Equals(inf1)); | 124 EXPECT_TRUE(inf1.Equals(inf1)); |
125 EXPECT_TRUE(inf1.Equals(inf2)); | 125 EXPECT_TRUE(inf1.Equals(inf2)); |
126 | 126 |
127 auto inf1_request = GetProxy(&inf1); | 127 auto inf1_request = MakeRequest(&inf1); |
128 ALLOW_UNUSED_LOCAL(inf1_request); | 128 ALLOW_UNUSED_LOCAL(inf1_request); |
129 | 129 |
130 EXPECT_TRUE(inf1.Equals(inf1)); | 130 EXPECT_TRUE(inf1.Equals(inf1)); |
131 EXPECT_FALSE(inf1.Equals(inf2)); | 131 EXPECT_FALSE(inf1.Equals(inf2)); |
132 | 132 |
133 auto inf2_request = GetProxy(&inf2); | 133 auto inf2_request = MakeRequest(&inf2); |
134 ALLOW_UNUSED_LOCAL(inf2_request); | 134 ALLOW_UNUSED_LOCAL(inf2_request); |
135 | 135 |
136 EXPECT_FALSE(inf1.Equals(inf2)); | 136 EXPECT_FALSE(inf1.Equals(inf2)); |
137 } | 137 } |
138 | 138 |
139 TEST_F(EqualsTest, InterfaceRequest) { | 139 TEST_F(EqualsTest, InterfaceRequest) { |
140 base::MessageLoop message_loop; | 140 base::MessageLoop message_loop; |
141 | 141 |
142 InterfaceRequest<SomeInterface> req1; | 142 InterfaceRequest<SomeInterface> req1; |
143 InterfaceRequest<SomeInterface> req2; | 143 InterfaceRequest<SomeInterface> req2; |
144 | 144 |
145 EXPECT_TRUE(req1.Equals(req1)); | 145 EXPECT_TRUE(req1.Equals(req1)); |
146 EXPECT_TRUE(req1.Equals(req2)); | 146 EXPECT_TRUE(req1.Equals(req2)); |
147 | 147 |
148 SomeInterfacePtr inf1; | 148 SomeInterfacePtr inf1; |
149 req1 = GetProxy(&inf1); | 149 req1 = MakeRequest(&inf1); |
150 | 150 |
151 EXPECT_TRUE(req1.Equals(req1)); | 151 EXPECT_TRUE(req1.Equals(req1)); |
152 EXPECT_FALSE(req1.Equals(req2)); | 152 EXPECT_FALSE(req1.Equals(req2)); |
153 | 153 |
154 SomeInterfacePtr inf2; | 154 SomeInterfacePtr inf2; |
155 req2 = GetProxy(&inf2); | 155 req2 = MakeRequest(&inf2); |
156 | 156 |
157 EXPECT_FALSE(req1.Equals(req2)); | 157 EXPECT_FALSE(req1.Equals(req2)); |
158 } | 158 } |
159 | 159 |
160 } // test | 160 } // test |
161 } // mojo | 161 } // mojo |
OLD | NEW |