| OLD | NEW |
| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 if (!done.is_null()) | 199 if (!done.is_null()) |
| 200 done.Run(); | 200 done.Run(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 protocol::FrameConsumer::PixelFormat GetPixelFormat() override { | 203 protocol::FrameConsumer::PixelFormat GetPixelFormat() override { |
| 204 return FORMAT_BGRA; | 204 return FORMAT_BGRA; |
| 205 } | 205 } |
| 206 | 206 |
| 207 // HostStatusObserver interface. | 207 // HostStatusObserver interface. |
| 208 void OnClientConnected(const std::string& jid) override { | 208 void OnClientConnected(const std::string& jid) override { |
| 209 message_loop_.PostTask( | 209 message_loop_.task_runner()->PostTask( |
| 210 FROM_HERE, | 210 FROM_HERE, base::Bind(&ProtocolPerfTest::OnHostConnectedMainThread, |
| 211 base::Bind(&ProtocolPerfTest::OnHostConnectedMainThread, | 211 base::Unretained(this))); |
| 212 base::Unretained(this))); | |
| 213 } | 212 } |
| 214 | 213 |
| 215 protected: | 214 protected: |
| 216 void WaitConnected() { | 215 void WaitConnected() { |
| 217 client_connected_ = false; | 216 client_connected_ = false; |
| 218 host_connected_ = false; | 217 host_connected_ = false; |
| 219 | 218 |
| 220 connecting_loop_.reset(new base::RunLoop()); | 219 connecting_loop_.reset(new base::RunLoop()); |
| 221 connecting_loop_->Run(); | 220 connecting_loop_->Run(); |
| 222 | 221 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 std::string host_pin_hash = | 355 std::string host_pin_hash = |
| 357 protocol::GetSharedSecretHash(kHostId, kHostPin); | 356 protocol::GetSharedSecretHash(kHostId, kHostPin); |
| 358 std::unique_ptr<protocol::AuthenticatorFactory> auth_factory = | 357 std::unique_ptr<protocol::AuthenticatorFactory> auth_factory = |
| 359 protocol::Me2MeHostAuthenticatorFactory::CreateWithPin( | 358 protocol::Me2MeHostAuthenticatorFactory::CreateWithPin( |
| 360 true, kHostOwner, host_cert, key_pair, "", host_pin_hash, nullptr); | 359 true, kHostOwner, host_cert, key_pair, "", host_pin_hash, nullptr); |
| 361 host_->SetAuthenticatorFactory(std::move(auth_factory)); | 360 host_->SetAuthenticatorFactory(std::move(auth_factory)); |
| 362 | 361 |
| 363 host_->AddStatusObserver(this); | 362 host_->AddStatusObserver(this); |
| 364 host_->Start(kHostOwner); | 363 host_->Start(kHostOwner); |
| 365 | 364 |
| 366 message_loop_.PostTask(FROM_HERE, | 365 message_loop_.task_runner()->PostTask( |
| 367 base::Bind(&ProtocolPerfTest::StartClientAfterHost, | 366 FROM_HERE, base::Bind(&ProtocolPerfTest::StartClientAfterHost, |
| 368 base::Unretained(this))); | 367 base::Unretained(this))); |
| 369 } | 368 } |
| 370 | 369 |
| 371 void StartClientAfterHost() { | 370 void StartClientAfterHost() { |
| 372 client_signaling_->ConnectTo(host_signaling_.get()); | 371 client_signaling_->ConnectTo(host_signaling_.get()); |
| 373 | 372 |
| 374 protocol::NetworkSettings network_settings( | 373 protocol::NetworkSettings network_settings( |
| 375 protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING); | 374 protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING); |
| 376 | 375 |
| 377 // Initialize client. | 376 // Initialize client. |
| 378 client_context_.reset( | 377 client_context_.reset( |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 632 |
| 634 TEST_P(ProtocolPerfTest, TotalLatencyIce) { | 633 TEST_P(ProtocolPerfTest, TotalLatencyIce) { |
| 635 MeasureTotalLatency(false); | 634 MeasureTotalLatency(false); |
| 636 } | 635 } |
| 637 | 636 |
| 638 TEST_P(ProtocolPerfTest, TotalLatencyWebrtc) { | 637 TEST_P(ProtocolPerfTest, TotalLatencyWebrtc) { |
| 639 MeasureTotalLatency(true); | 638 MeasureTotalLatency(true); |
| 640 } | 639 } |
| 641 | 640 |
| 642 } // namespace remoting | 641 } // namespace remoting |
| OLD | NEW |