| 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/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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ASSERT_EQ(Authenticator::REJECTED, client_->state()); | 78 ASSERT_EQ(Authenticator::REJECTED, client_->state()); |
| 79 | 79 |
| 80 // Change |client_| so that we can get the last message. | 80 // Change |client_| so that we can get the last message. |
| 81 reinterpret_cast<V2Authenticator*>(client_.get())->state_ = | 81 reinterpret_cast<V2Authenticator*>(client_.get())->state_ = |
| 82 Authenticator::MESSAGE_READY; | 82 Authenticator::MESSAGE_READY; |
| 83 | 83 |
| 84 scoped_ptr<buzz::XmlElement> message(client_->GetNextMessage()); | 84 scoped_ptr<buzz::XmlElement> message(client_->GetNextMessage()); |
| 85 ASSERT_TRUE(message.get()); | 85 ASSERT_TRUE(message.get()); |
| 86 | 86 |
| 87 ASSERT_EQ(Authenticator::WAITING_MESSAGE, client_->state()); | 87 ASSERT_EQ(Authenticator::WAITING_MESSAGE, client_->state()); |
| 88 host_->ProcessMessage(message.get()); | 88 host_->ProcessMessage(message.get(), base::Bind(&base::DoNothing)); |
| 89 // This assumes that V2Authenticator::ProcessMessage runs synchronously. |
| 89 ASSERT_EQ(Authenticator::REJECTED, host_->state()); | 90 ASSERT_EQ(Authenticator::REJECTED, host_->state()); |
| 90 } | 91 } |
| 91 | 92 |
| 92 } // namespace protocol | 93 } // namespace protocol |
| 93 } // namespace remoting | 94 } // namespace remoting |
| OLD | NEW |