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

Side by Side Diff: remoting/protocol/connection_unittest.cc

Issue 2757923004: Fix failed capture handling in WebrtcVideoStream (Closed)
Patch Set: Created 3 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 Connect(); 628 Connect();
629 629
630 std::unique_ptr<AudioStream> audio_stream = 630 std::unique_ptr<AudioStream> audio_stream =
631 host_connection_->StartAudioStream(base::MakeUnique<TestAudioSource>()); 631 host_connection_->StartAudioStream(base::MakeUnique<TestAudioSource>());
632 632
633 // Wait for 1 second worth of audio samples. 633 // Wait for 1 second worth of audio samples.
634 client_audio_player_.WaitForSamples(kAudioSampleRate * 2); 634 client_audio_player_.WaitForSamples(kAudioSampleRate * 2);
635 client_audio_player_.Verify(); 635 client_audio_player_.Verify();
636 } 636 }
637 637
638 #if !defined(MEMORY_SANITIZER)
639 // Test fails under msan, https://crbug.com/697178
640 TEST_P(ConnectionTest, FirstCaptureFailed) { 638 TEST_P(ConnectionTest, FirstCaptureFailed) {
641 Connect(); 639 Connect();
642 640
643 base::TimeTicks event_timestamp = base::TimeTicks::FromInternalValue(42); 641 base::TimeTicks event_timestamp = base::TimeTicks::FromInternalValue(42);
644 642
645 scoped_refptr<InputEventTimestampsSourceImpl> input_event_timestamps_source = 643 scoped_refptr<InputEventTimestampsSourceImpl> input_event_timestamps_source =
646 new InputEventTimestampsSourceImpl(); 644 new InputEventTimestampsSourceImpl();
647 input_event_timestamps_source->OnEventReceived( 645 input_event_timestamps_source->OnEventReceived(
648 InputEventTimestamps{event_timestamp, base::TimeTicks::Now()}); 646 InputEventTimestamps{event_timestamp, base::TimeTicks::Now()});
649 647
(...skipping 12 matching lines...) Expand all
662 WaitFirstFrameStats(); 660 WaitFirstFrameStats();
663 661
664 // Verify that the event timestamp received before the first frame gets used 662 // Verify that the event timestamp received before the first frame gets used
665 // for the second frame. 663 // for the second frame.
666 const FrameStats& stats = client_video_renderer_.GetFrameStatsConsumer() 664 const FrameStats& stats = client_video_renderer_.GetFrameStatsConsumer()
667 ->received_stats() 665 ->received_stats()
668 .front(); 666 .front();
669 EXPECT_EQ(event_timestamp, stats.host_stats.latest_event_timestamp); 667 EXPECT_EQ(event_timestamp, stats.host_stats.latest_event_timestamp);
670 } 668 }
671 } 669 }
672 #endif
673 670
674 TEST_P(ConnectionTest, SecondCaptureFailed) { 671 TEST_P(ConnectionTest, SecondCaptureFailed) {
675 Connect(); 672 Connect();
676 673
677 auto capturer = base::MakeUnique<TestScreenCapturer>(); 674 auto capturer = base::MakeUnique<TestScreenCapturer>();
678 capturer->FailNthFrame(1); 675 capturer->FailNthFrame(1);
679 auto video_stream = host_connection_->StartVideoStream(std::move(capturer)); 676 auto video_stream = host_connection_->StartVideoStream(std::move(capturer));
680 677
681 WaitNextVideoFrame(); 678 WaitNextVideoFrame();
682 WaitNextVideoFrame(); 679 WaitNextVideoFrame();
683 } 680 }
684 681
685 } // namespace protocol 682 } // namespace protocol
686 } // namespace remoting 683 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/protocol/webrtc_frame_scheduler_simple.h » ('j') | remoting/protocol/webrtc_frame_scheduler_simple.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698