| OLD | NEW |
| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 client_connection_->input_stub()->InjectKeyEvent(event); | 343 client_connection_->input_stub()->InjectKeyEvent(event); |
| 344 | 344 |
| 345 run_loop.Run(); | 345 run_loop.Run(); |
| 346 } | 346 } |
| 347 | 347 |
| 348 TEST_P(ConnectionTest, Video) { | 348 TEST_P(ConnectionTest, Video) { |
| 349 Connect(); | 349 Connect(); |
| 350 | 350 |
| 351 std::unique_ptr<VideoStream> video_stream = | 351 std::unique_ptr<VideoStream> video_stream = |
| 352 host_connection_->StartVideoStream( | 352 host_connection_->StartVideoStream( |
| 353 base::WrapUnique(new TestScreenCapturer())); | 353 base::MakeUnique<TestScreenCapturer>()); |
| 354 | 354 |
| 355 WaitFirstVideoFrame(); | 355 WaitFirstVideoFrame(); |
| 356 } | 356 } |
| 357 | 357 |
| 358 // Verifies that the VideoStream doesn't loose any video frames while the | 358 // Verifies that the VideoStream doesn't loose any video frames while the |
| 359 // connection is being established. | 359 // connection is being established. |
| 360 TEST_P(ConnectionTest, VideoWithSlowSignaling) { | 360 TEST_P(ConnectionTest, VideoWithSlowSignaling) { |
| 361 // Add signaling delay to slow down connection handshake. | 361 // Add signaling delay to slow down connection handshake. |
| 362 host_session_->set_signaling_delay(base::TimeDelta::FromMilliseconds(100)); | 362 host_session_->set_signaling_delay(base::TimeDelta::FromMilliseconds(100)); |
| 363 client_session_->set_signaling_delay(base::TimeDelta::FromMilliseconds(100)); | 363 client_session_->set_signaling_delay(base::TimeDelta::FromMilliseconds(100)); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // TODO(sergeyu): Fix this. | 398 // TODO(sergeyu): Fix this. |
| 399 if (!is_using_webrtc()) | 399 if (!is_using_webrtc()) |
| 400 return; | 400 return; |
| 401 | 401 |
| 402 Connect(); | 402 Connect(); |
| 403 | 403 |
| 404 base::TimeTicks start_time = base::TimeTicks::Now(); | 404 base::TimeTicks start_time = base::TimeTicks::Now(); |
| 405 | 405 |
| 406 std::unique_ptr<VideoStream> video_stream = | 406 std::unique_ptr<VideoStream> video_stream = |
| 407 host_connection_->StartVideoStream( | 407 host_connection_->StartVideoStream( |
| 408 base::WrapUnique(new TestScreenCapturer())); | 408 base::MakeUnique<TestScreenCapturer>()); |
| 409 | 409 |
| 410 // Simulate an input invent injected at the start. | 410 // Simulate an input invent injected at the start. |
| 411 video_stream->OnInputEventReceived(start_time.ToInternalValue()); | 411 video_stream->OnInputEventReceived(start_time.ToInternalValue()); |
| 412 | 412 |
| 413 WaitFirstVideoFrame(); | 413 WaitFirstVideoFrame(); |
| 414 | 414 |
| 415 base::TimeTicks finish_time = base::TimeTicks::Now(); | 415 base::TimeTicks finish_time = base::TimeTicks::Now(); |
| 416 | 416 |
| 417 WaitFirstFrameStats(); | 417 WaitFirstFrameStats(); |
| 418 | 418 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 440 stats.client_stats.time_received); | 440 stats.client_stats.time_received); |
| 441 EXPECT_TRUE(stats.client_stats.time_received <= | 441 EXPECT_TRUE(stats.client_stats.time_received <= |
| 442 stats.client_stats.time_decoded); | 442 stats.client_stats.time_decoded); |
| 443 EXPECT_TRUE(stats.client_stats.time_decoded <= | 443 EXPECT_TRUE(stats.client_stats.time_decoded <= |
| 444 stats.client_stats.time_rendered); | 444 stats.client_stats.time_rendered); |
| 445 EXPECT_TRUE(stats.client_stats.time_rendered <= finish_time); | 445 EXPECT_TRUE(stats.client_stats.time_rendered <= finish_time); |
| 446 } | 446 } |
| 447 | 447 |
| 448 } // namespace protocol | 448 } // namespace protocol |
| 449 } // namespace remoting | 449 } // namespace remoting |
| OLD | NEW |