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

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

Issue 12389010: Refactor of Authenticator to allow it to ProcessMessage asynchronously and then call a callback (Closed) Base URL: http://git.chromium.org/chromium/src.git@host_key_pair
Patch Set: Created 7 years, 9 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
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/base/rsa_key_pair.h" 9 #include "remoting/base/rsa_key_pair.h"
10 #include "remoting/protocol/authenticator_test_base.h" 10 #include "remoting/protocol/authenticator_test_base.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 ASSERT_EQ(Authenticator::REJECTED, client_->state()); 80 ASSERT_EQ(Authenticator::REJECTED, client_->state());
81 81
82 // Change |client_| so that we can get the last message. 82 // Change |client_| so that we can get the last message.
83 reinterpret_cast<V2Authenticator*>(client_.get())->state_ = 83 reinterpret_cast<V2Authenticator*>(client_.get())->state_ =
84 Authenticator::MESSAGE_READY; 84 Authenticator::MESSAGE_READY;
85 85
86 scoped_ptr<buzz::XmlElement> message(client_->GetNextMessage()); 86 scoped_ptr<buzz::XmlElement> message(client_->GetNextMessage());
87 ASSERT_TRUE(message.get()); 87 ASSERT_TRUE(message.get());
88 88
89 ASSERT_EQ(Authenticator::WAITING_MESSAGE, client_->state()); 89 ASSERT_EQ(Authenticator::WAITING_MESSAGE, client_->state());
90 host_->ProcessMessage(message.get()); 90 host_->ProcessMessage(base::Bind(&base::DoNothing), message.get());
91 ASSERT_EQ(Authenticator::REJECTED, host_->state()); 91 ASSERT_EQ(Authenticator::REJECTED, host_->state());
92 } 92 }
93 93
94 } // namespace protocol 94 } // namespace protocol
95 } // namespace remoting 95 } // namespace remoting
OLDNEW
« remoting/protocol/negotiating_authenticator.cc ('K') | « remoting/protocol/v2_authenticator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698