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

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

Issue 1778023002: Move NegotiatingClientAuthentication creation to ChromotingClient. (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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <utility> 5 #include <utility>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 GetParam().bandwidth, GetParam().max_buffers); 381 GetParam().bandwidth, GetParam().max_buffers);
382 port_allocator_factory->socket_factory()->SetLatency( 382 port_allocator_factory->socket_factory()->SetLatency(
383 GetParam().latency_average, GetParam().latency_stddev); 383 GetParam().latency_average, GetParam().latency_stddev);
384 port_allocator_factory->socket_factory()->set_out_of_order_rate( 384 port_allocator_factory->socket_factory()->set_out_of_order_rate(
385 GetParam().out_of_order_rate); 385 GetParam().out_of_order_rate);
386 scoped_refptr<protocol::TransportContext> transport_context( 386 scoped_refptr<protocol::TransportContext> transport_context(
387 new protocol::TransportContext( 387 new protocol::TransportContext(
388 host_signaling_.get(), std::move(port_allocator_factory), nullptr, 388 host_signaling_.get(), std::move(port_allocator_factory), nullptr,
389 network_settings, protocol::TransportRole::CLIENT)); 389 network_settings, protocol::TransportRole::CLIENT));
390 390
391 scoped_ptr<protocol::Authenticator> client_authenticator( 391 protocol::ClientAuthenticationConfig client_auth_config;
392 new protocol::NegotiatingClientAuthenticator( 392 client_auth_config.host_id = kHostId;
393 std::string(), // client_pairing_id 393 client_auth_config.fetch_secret_callback =
394 std::string(), // client_pairing_secret 394 base::Bind(&ProtocolPerfTest::FetchPin, base::Unretained(this));
395 kHostId, 395
396 base::Bind(&ProtocolPerfTest::FetchPin, base::Unretained(this)),
397 protocol::FetchThirdPartyTokenCallback()));
398 client_.reset( 396 client_.reset(
399 new ChromotingClient(client_context_.get(), this, this, nullptr)); 397 new ChromotingClient(client_context_.get(), this, this, nullptr));
400 client_->set_protocol_config(protocol_config_->Clone()); 398 client_->set_protocol_config(protocol_config_->Clone());
401 client_->Start(client_signaling_.get(), std::move(client_authenticator), 399 client_->Start(client_signaling_.get(), client_auth_config,
402 transport_context, kHostJid, std::string()); 400 transport_context, kHostJid, std::string());
403 } 401 }
404 402
405 void FetchPin( 403 void FetchPin(
406 bool pairing_supported, 404 bool pairing_supported,
407 const protocol::SecretFetchedCallback& secret_fetched_callback) { 405 const protocol::SecretFetchedCallback& secret_fetched_callback) {
408 secret_fetched_callback.Run(kHostPin); 406 secret_fetched_callback.Run(kHostPin);
409 } 407 }
410 408
411 void MeasureTotalLatency(bool webrtc) { 409 void MeasureTotalLatency(bool webrtc) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 627
630 TEST_P(ProtocolPerfTest, TotalLatencyIce) { 628 TEST_P(ProtocolPerfTest, TotalLatencyIce) {
631 MeasureTotalLatency(false); 629 MeasureTotalLatency(false);
632 } 630 }
633 631
634 TEST_P(ProtocolPerfTest, TotalLatencyWebrtc) { 632 TEST_P(ProtocolPerfTest, TotalLatencyWebrtc) {
635 MeasureTotalLatency(true); 633 MeasureTotalLatency(true);
636 } 634 }
637 635
638 } // namespace remoting 636 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/negotiating_client_authenticator.cc ('k') | remoting/test/test_chromoting_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698