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

Unified Diff: remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc

Issue 551173004: Move PseudoTCP and channel auth out of LibjingleTransportFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clean_dgrams
Patch Set: Created 6 years, 3 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/protocol/ssl_hmac_channel_authenticator.cc ('k') | remoting/protocol/stream_channel_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc b/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
index cb239fbdc279dc041ae4f40732f9450250b2e1c5..3b0818e17d3e76211e057374ffe2e0804f7c78d1 100644
--- a/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
+++ b/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
@@ -36,7 +36,7 @@ const char kTestSharedSecretBad[] = "0000-0000-0001";
class MockChannelDoneCallback {
public:
- MOCK_METHOD2(OnDone, void(net::Error error, net::StreamSocket* socket));
+ MOCK_METHOD2(OnDone, void(int error, net::StreamSocket* socket));
};
ACTION_P(QuitThreadOnCounter, counter) {
@@ -82,7 +82,7 @@ class SslHmacChannelAuthenticatorTest : public testing::Test {
host_auth_->SecureAndAuthenticate(
host_fake_socket_.PassAs<net::StreamSocket>(),
base::Bind(&SslHmacChannelAuthenticatorTest::OnHostConnected,
- base::Unretained(this)));
+ base::Unretained(this), std::string("ref argument value")));
// Expect two callbacks to be called - the client callback and the host
// callback.
@@ -109,14 +109,20 @@ class SslHmacChannelAuthenticatorTest : public testing::Test {
message_loop_.Run();
}
- void OnHostConnected(net::Error error,
+ void OnHostConnected(const std::string& ref_argument,
+ int error,
scoped_ptr<net::StreamSocket> socket) {
+ // Try deleting the authenticator and verify that this doesn't destroy
+ // reference parameters.
+ host_auth_.reset();
+ DCHECK_EQ(ref_argument, "ref argument value");
+
host_callback_.OnDone(error, socket.get());
host_socket_ = socket.Pass();
}
- void OnClientConnected(net::Error error,
- scoped_ptr<net::StreamSocket> socket) {
+ void OnClientConnected(int error, scoped_ptr<net::StreamSocket> socket) {
+ client_auth_.reset();
client_callback_.OnDone(error, socket.get());
client_socket_ = socket.Pass();
}
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator.cc ('k') | remoting/protocol/stream_channel_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698