Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Unified Diff: remoting/protocol/negotiating_authenticator_unittest.cc

Issue 21128006: Refactored PairingRegistry::Delegate such that it can retrieve/modify for a single client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/setup/native_messaging_host_unittest.cc ('k') | remoting/protocol/pairing_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/negotiating_authenticator_unittest.cc
diff --git a/remoting/protocol/negotiating_authenticator_unittest.cc b/remoting/protocol/negotiating_authenticator_unittest.cc
index b746432eb6a0c6b065af44535fcfa61e2e2445b1..bd68b708d95ffcb3d063e65692f1c20ba40ee384 100644
--- a/remoting/protocol/negotiating_authenticator_unittest.cc
+++ b/remoting/protocol/negotiating_authenticator_unittest.cc
@@ -84,14 +84,13 @@ class NegotiatingAuthenticatorTest : public AuthenticatorTestBase {
}
void CreatePairingRegistry(bool with_paired_client) {
- mock_delegate_ = new MockPairingRegistryDelegate;
- pairing_registry_ = new PairingRegistry(
- scoped_ptr<PairingRegistry::Delegate>(mock_delegate_));
+ pairing_registry_ = new SynchronousPairingRegistry(
+ scoped_ptr<PairingRegistry::Delegate>(
+ new MockPairingRegistryDelegate()));
if (with_paired_client) {
PairingRegistry::Pairing pairing(
base::Time(), kTestClientName, kTestClientId, kTestPairedSecret);
pairing_registry_->AddPairing(pairing);
- mock_delegate_->RunCallback();
}
}
@@ -142,9 +141,6 @@ class NegotiatingAuthenticatorTest : public AuthenticatorTestBase {
// Use a bare pointer because the storage is managed by the base class.
NegotiatingClientAuthenticator* client_as_negotiating_authenticator_;
- protected:
- MockPairingRegistryDelegate* mock_delegate_;
-
private:
scoped_refptr<PairingRegistry> pairing_registry_;
@@ -217,7 +213,6 @@ TEST_F(NegotiatingAuthenticatorTest, PairingRevokedPinOkay) {
kTestClientId, kTestPairedSecret, kTestPin, kTestPin,
AuthenticationMethod::HMAC_SHA256, false));
ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
- mock_delegate_->RunCallback();
VerifyAccepted(AuthenticationMethod::Spake2Pair());
}
@@ -227,7 +222,6 @@ TEST_F(NegotiatingAuthenticatorTest, PairingRevokedPinBad) {
kTestClientId, kTestPairedSecret, kTestPinBad, kTestPin,
AuthenticationMethod::HMAC_SHA256, false));
ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
- mock_delegate_->RunCallback();
VerifyRejected(Authenticator::INVALID_CREDENTIALS);
}
@@ -237,7 +231,6 @@ TEST_F(NegotiatingAuthenticatorTest, PairingSucceeded) {
kTestClientId, kTestPairedSecret, kTestPinBad, kTestPin,
AuthenticationMethod::HMAC_SHA256, false));
ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
- mock_delegate_->RunCallback();
VerifyAccepted(AuthenticationMethod::Spake2Pair());
}
@@ -247,7 +240,6 @@ TEST_F(NegotiatingAuthenticatorTest, PairingSucceededInvalidSecretButPinOkay) {
kTestClientId, kTestPairedSecretBad, kTestPin, kTestPin,
AuthenticationMethod::HMAC_SHA256, false));
ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
- mock_delegate_->RunCallback();
VerifyAccepted(AuthenticationMethod::Spake2Pair());
}
@@ -257,7 +249,6 @@ TEST_F(NegotiatingAuthenticatorTest, PairingFailedInvalidSecretAndPin) {
kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin,
AuthenticationMethod::HMAC_SHA256, false));
ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
- mock_delegate_->RunCallback();
VerifyRejected(Authenticator::INVALID_CREDENTIALS);
}
« no previous file with comments | « remoting/host/setup/native_messaging_host_unittest.cc ('k') | remoting/protocol/pairing_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698