OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 // A test which runs both Chromium and Blink implementations of the | 154 // A test which runs both Chromium and Blink implementations of the |
155 // PicklePasser service. | 155 // PicklePasser service. |
156 class PickleTest : public testing::Test { | 156 class PickleTest : public testing::Test { |
157 public: | 157 public: |
158 PickleTest() {} | 158 PickleTest() {} |
159 | 159 |
160 template <typename ProxyType = PicklePasser> | 160 template <typename ProxyType = PicklePasser> |
161 InterfacePtr<ProxyType> ConnectToChromiumService() { | 161 InterfacePtr<ProxyType> ConnectToChromiumService() { |
162 InterfacePtr<ProxyType> proxy; | 162 InterfacePtr<ProxyType> proxy; |
163 InterfaceRequest<ProxyType> request = GetProxy(&proxy); | 163 InterfaceRequest<ProxyType> request = MakeRequest(&proxy); |
164 chromium_bindings_.AddBinding( | 164 chromium_bindings_.AddBinding( |
165 &chromium_service_, | 165 &chromium_service_, |
166 ConvertInterfaceRequest<PicklePasser>(std::move(request))); | 166 ConvertInterfaceRequest<PicklePasser>(std::move(request))); |
167 return proxy; | 167 return proxy; |
168 } | 168 } |
169 | 169 |
170 template <typename ProxyType = blink::PicklePasser> | 170 template <typename ProxyType = blink::PicklePasser> |
171 InterfacePtr<ProxyType> ConnectToBlinkService() { | 171 InterfacePtr<ProxyType> ConnectToBlinkService() { |
172 InterfacePtr<ProxyType> proxy; | 172 InterfacePtr<ProxyType> proxy; |
173 InterfaceRequest<ProxyType> request = GetProxy(&proxy); | 173 InterfaceRequest<ProxyType> request = MakeRequest(&proxy); |
174 blink_bindings_.AddBinding( | 174 blink_bindings_.AddBinding( |
175 &blink_service_, | 175 &blink_service_, |
176 ConvertInterfaceRequest<blink::PicklePasser>(std::move(request))); | 176 ConvertInterfaceRequest<blink::PicklePasser>(std::move(request))); |
177 return proxy; | 177 return proxy; |
178 } | 178 } |
179 | 179 |
180 private: | 180 private: |
181 base::MessageLoop loop_; | 181 base::MessageLoop loop_; |
182 ChromiumPicklePasserImpl chromium_service_; | 182 ChromiumPicklePasserImpl chromium_service_; |
183 BindingSet<PicklePasser> chromium_bindings_; | 183 BindingSet<PicklePasser> chromium_bindings_; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 EXPECT_EQ(PickledEnumChromium::VALUE_1, | 399 EXPECT_EQ(PickledEnumChromium::VALUE_1, |
400 passed->f_enum); | 400 passed->f_enum); |
401 run_loop.Quit(); | 401 run_loop.Quit(); |
402 })); | 402 })); |
403 run_loop.Run(); | 403 run_loop.Run(); |
404 } | 404 } |
405 } | 405 } |
406 | 406 |
407 } // namespace test | 407 } // namespace test |
408 } // namespace mojo | 408 } // namespace mojo |
OLD | NEW |