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

Side by Side Diff: remoting/protocol/v2_authenticator_unittest.cc

Issue 10454066: Move the core state machine of SSLClientSocketNSS into a thread-safe Core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win_rel by not caching the current threads task runner. See added comment Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v2_authenticator.h" 5 #include "remoting/protocol/v2_authenticator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "remoting/protocol/authenticator_test_base.h" 9 #include "remoting/protocol/authenticator_test_base.h"
10 #include "remoting/protocol/channel_authenticator.h" 10 #include "remoting/protocol/channel_authenticator.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 InitAuthenticators(kTestSharedSecret, kTestSharedSecret)); 54 InitAuthenticators(kTestSharedSecret, kTestSharedSecret));
55 ASSERT_NO_FATAL_FAILURE(RunAuthExchange()); 55 ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
56 56
57 ASSERT_EQ(Authenticator::ACCEPTED, host_->state()); 57 ASSERT_EQ(Authenticator::ACCEPTED, host_->state());
58 ASSERT_EQ(Authenticator::ACCEPTED, client_->state()); 58 ASSERT_EQ(Authenticator::ACCEPTED, client_->state());
59 59
60 client_auth_ = client_->CreateChannelAuthenticator(); 60 client_auth_ = client_->CreateChannelAuthenticator();
61 host_auth_ = host_->CreateChannelAuthenticator(); 61 host_auth_ = host_->CreateChannelAuthenticator();
62 RunChannelAuth(false); 62 RunChannelAuth(false);
63 63
64 EXPECT_TRUE(client_socket_.get() != NULL);
65 EXPECT_TRUE(host_socket_.get() != NULL);
66
67 StreamConnectionTester tester(host_socket_.get(), client_socket_.get(), 64 StreamConnectionTester tester(host_socket_.get(), client_socket_.get(),
68 kMessageSize, kMessages); 65 kMessageSize, kMessages);
69 66
70 tester.Start(); 67 tester.Start();
71 message_loop_.Run(); 68 message_loop_.Run();
72 tester.CheckResults(); 69 tester.CheckResults();
73 } 70 }
74 71
75 // Verify that connection is rejected when secrets don't match. 72 // Verify that connection is rejected when secrets don't match.
76 TEST_F(V2AuthenticatorTest, InvalidSecret) { 73 TEST_F(V2AuthenticatorTest, InvalidSecret) {
(...skipping 10 matching lines...) Expand all
87 scoped_ptr<buzz::XmlElement> message(client_->GetNextMessage()); 84 scoped_ptr<buzz::XmlElement> message(client_->GetNextMessage());
88 ASSERT_TRUE(message.get()); 85 ASSERT_TRUE(message.get());
89 86
90 ASSERT_EQ(Authenticator::WAITING_MESSAGE, client_->state()); 87 ASSERT_EQ(Authenticator::WAITING_MESSAGE, client_->state());
91 host_->ProcessMessage(message.get()); 88 host_->ProcessMessage(message.get());
92 ASSERT_EQ(Authenticator::REJECTED, host_->state()); 89 ASSERT_EQ(Authenticator::REJECTED, host_->state());
93 } 90 }
94 91
95 } // namespace protocol 92 } // namespace protocol
96 } // namespace remoting 93 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698