Chromium Code Reviews| Index: remoting/protocol/protocol_mock_objects.cc |
| diff --git a/remoting/protocol/protocol_mock_objects.cc b/remoting/protocol/protocol_mock_objects.cc |
| index 072cf3c34deb23e5f1045ae78fa8f5ebed8105f2..54c609d1f3549d146c007da4df3f92f6646b7f1f 100644 |
| --- a/remoting/protocol/protocol_mock_objects.cc |
| +++ b/remoting/protocol/protocol_mock_objects.cc |
| @@ -4,7 +4,7 @@ |
| #include "remoting/protocol/protocol_mock_objects.h" |
| -#include "base/message_loop/message_loop_proxy.h" |
| +#include "base/message_loop.h" |
|
rmsousa
2013/06/13 04:26:19
Nit: is this needed?
Jamie
2013/06/13 17:22:15
Not any more, and neither are the other includes,
|
| #include "net/base/ip_endpoint.h" |
| #include "remoting/protocol/transport.h" |
| @@ -52,5 +52,34 @@ MockSessionManager::MockSessionManager() {} |
| MockSessionManager::~MockSessionManager() {} |
| +MockPairingRegistryDelegate::MockPairingRegistryDelegate() { |
| +} |
| + |
| +MockPairingRegistryDelegate::~MockPairingRegistryDelegate() { |
| +} |
| + |
| +void MockPairingRegistryDelegate::AddPairing( |
| + const PairingRegistry::Pairing& new_paired_client) OVERRIDE { |
| + paired_clients_[new_paired_client.client_id] = new_paired_client; |
| +} |
| + |
| +void MockPairingRegistryDelegate::GetPairing( |
| + const std::string& client_id, |
| + const PairingRegistry::GetPairingCallback& callback) OVERRIDE { |
| + PairingRegistry::Pairing result; |
| + PairingRegistry::PairedClients::const_iterator i = |
| + paired_clients_.find(client_id); |
| + if (i != paired_clients_.end()) { |
| + result = i->second; |
| + } |
| + saved_callback_ = base::Bind(base::Bind(callback), result); |
| +} |
| + |
| +void MockPairingRegistryDelegate::RunCallback() { |
| + DCHECK(!saved_callback_.is_null()); |
| + saved_callback_.Run(); |
| + saved_callback_.Reset(); |
| +} |
| + |
| } // namespace protocol |
| } // namespace remoting |