OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ | 5 #ifndef REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ |
6 #define REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ | 6 #define REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 private: | 204 private: |
205 DISALLOW_COPY_AND_ASSIGN(MockSessionManager); | 205 DISALLOW_COPY_AND_ASSIGN(MockSessionManager); |
206 }; | 206 }; |
207 | 207 |
208 // Simple delegate that caches information on paired clients in memory. | 208 // Simple delegate that caches information on paired clients in memory. |
209 class MockPairingRegistryDelegate : public PairingRegistry::Delegate { | 209 class MockPairingRegistryDelegate : public PairingRegistry::Delegate { |
210 public: | 210 public: |
211 MockPairingRegistryDelegate(); | 211 MockPairingRegistryDelegate(); |
212 virtual ~MockPairingRegistryDelegate(); | 212 virtual ~MockPairingRegistryDelegate(); |
213 | 213 |
214 const PairingRegistry::PairedClients& paired_clients() const { | 214 const std::string& pairings_json() const { |
215 return paired_clients_; | 215 return pairings_json_; |
216 } | 216 } |
217 | 217 |
218 // PairingRegistry::Delegate implementation. | 218 // PairingRegistry::Delegate implementation. |
219 virtual void AddPairing( | 219 virtual void Save( |
220 const PairingRegistry::Pairing& new_paired_client, | 220 const std::string& pairings_json, |
221 const PairingRegistry::AddPairingCallback& callback) OVERRIDE; | 221 const PairingRegistry::SaveCallback& callback) OVERRIDE; |
222 virtual void GetPairing( | 222 virtual void Load( |
223 const std::string& client_id, | 223 const PairingRegistry::LoadCallback& callback) OVERRIDE; |
224 const PairingRegistry::GetPairingCallback& callback) OVERRIDE; | |
225 | 224 |
226 void RunCallback(); | 225 void RunCallback(); |
227 | 226 |
228 private: | 227 private: |
229 base::Closure saved_callback_; | 228 base::Closure load_callback_; |
230 PairingRegistry::PairedClients paired_clients_; | 229 std::string pairings_json_; |
231 }; | 230 }; |
232 | 231 |
233 } // namespace protocol | 232 } // namespace protocol |
234 } // namespace remoting | 233 } // namespace remoting |
235 | 234 |
236 #endif // REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ | 235 #endif // REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ |
OLD | NEW |