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 #include "remoting/protocol/pairing_registry.h" | 5 #include "remoting/protocol/pairing_registry.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 EXPECT_FALSE(actual.HasKey(PairingRegistry::kSharedSecretKey)); | 55 EXPECT_FALSE(actual.HasKey(PairingRegistry::kSharedSecretKey)); |
56 } | 56 } |
57 | 57 |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 namespace remoting { | 60 namespace remoting { |
61 namespace protocol { | 61 namespace protocol { |
62 | 62 |
63 class PairingRegistryTest : public testing::Test { | 63 class PairingRegistryTest : public testing::Test { |
64 public: | 64 public: |
65 virtual void SetUp() override { | 65 void SetUp() override { callback_count_ = 0; } |
66 callback_count_ = 0; | |
67 } | |
68 | 66 |
69 void set_pairings(scoped_ptr<base::ListValue> pairings) { | 67 void set_pairings(scoped_ptr<base::ListValue> pairings) { |
70 pairings_ = pairings.Pass(); | 68 pairings_ = pairings.Pass(); |
71 } | 69 } |
72 | 70 |
73 void ExpectSecret(const std::string& expected, | 71 void ExpectSecret(const std::string& expected, |
74 PairingRegistry::Pairing actual) { | 72 PairingRegistry::Pairing actual) { |
75 EXPECT_EQ(expected, actual.shared_secret()); | 73 EXPECT_EQ(expected, actual.shared_secret()); |
76 ++callback_count_; | 74 ++callback_count_; |
77 } | 75 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 registry->GetPairing( | 248 registry->GetPairing( |
251 pairing_3.client_id(), | 249 pairing_3.client_id(), |
252 base::Bind(&MockPairingRegistryCallbacks::GetPairingCallback, | 250 base::Bind(&MockPairingRegistryCallbacks::GetPairingCallback, |
253 base::Unretained(&callbacks))); | 251 base::Unretained(&callbacks))); |
254 | 252 |
255 run_loop_.Run(); | 253 run_loop_.Run(); |
256 } | 254 } |
257 | 255 |
258 } // namespace protocol | 256 } // namespace protocol |
259 } // namespace remoting | 257 } // namespace remoting |
OLD | NEW |