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

Side by Side Diff: remoting/test/test_chromoting_client_unittest.cc

Issue 1755273003: Simplify AuthenticationMethod type and PIN hash handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <string> 5 #include <string>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "remoting/protocol/fake_connection_to_host.h" 9 #include "remoting/protocol/fake_connection_to_host.h"
10 #include "remoting/signaling/fake_signal_strategy.h" 10 #include "remoting/signaling/fake_signal_strategy.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // keep the ptr around so we can use it to simulate state changes. It will 66 // keep the ptr around so we can use it to simulate state changes. It will
67 // remain valid until |test_chromoting_client_| is destroyed. 67 // remain valid until |test_chromoting_client_| is destroyed.
68 fake_connection_to_host_ = new FakeConnectionToHost(); 68 fake_connection_to_host_ = new FakeConnectionToHost();
69 test_chromoting_client_->SetSignalStrategyForTests(make_scoped_ptr( 69 test_chromoting_client_->SetSignalStrategyForTests(make_scoped_ptr(
70 new FakeSignalStrategy("test_user@faux_address.com/123"))); 70 new FakeSignalStrategy("test_user@faux_address.com/123")));
71 test_chromoting_client_->SetConnectionToHostForTests( 71 test_chromoting_client_->SetConnectionToHostForTests(
72 make_scoped_ptr(fake_connection_to_host_)); 72 make_scoped_ptr(fake_connection_to_host_));
73 73
74 connection_setup_info_.host_jid = "test_host@faux_address.com/321"; 74 connection_setup_info_.host_jid = "test_host@faux_address.com/321";
75 connection_setup_info_.auth_methods.push_back( 75 connection_setup_info_.auth_methods.push_back(
76 protocol::AuthenticationMethod::ThirdParty()); 76 protocol::AuthenticationMethod::THIRD_PARTY);
77 } 77 }
78 78
79 void TestChromotingClientTest::TearDown() { 79 void TestChromotingClientTest::TearDown() {
80 test_chromoting_client_->RemoveRemoteConnectionObserver(this); 80 test_chromoting_client_->RemoveRemoteConnectionObserver(this);
81 fake_connection_to_host_ = nullptr; 81 fake_connection_to_host_ = nullptr;
82 82
83 // The chromoting instance must be destroyed before the message loop. 83 // The chromoting instance must be destroyed before the message loop.
84 test_chromoting_client_.reset(); 84 test_chromoting_client_.reset();
85 85
86 // The IceTransportFactory destroys the PortAllocator via a DeleteSoon 86 // The IceTransportFactory destroys the PortAllocator via a DeleteSoon
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // Close the connection via the TestChromotingClient and verify the error 195 // Close the connection via the TestChromotingClient and verify the error
196 // state is persisted. 196 // state is persisted.
197 test_chromoting_client_->EndConnection(); 197 test_chromoting_client_->EndConnection();
198 EXPECT_EQ(protocol::ConnectionToHost::State::FAILED, connection_state_); 198 EXPECT_EQ(protocol::ConnectionToHost::State::FAILED, connection_state_);
199 EXPECT_EQ(protocol::ErrorCode::UNKNOWN_ERROR, error_code_); 199 EXPECT_EQ(protocol::ErrorCode::UNKNOWN_ERROR, error_code_);
200 EXPECT_FALSE(is_connected_to_host_); 200 EXPECT_FALSE(is_connected_to_host_);
201 } 201 }
202 202
203 } // namespace test 203 } // namespace test
204 } // namespace remoting 204 } // namespace remoting
OLDNEW
« remoting/protocol/negotiating_client_authenticator.cc ('K') | « remoting/test/remote_host_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698