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

Side by Side Diff: talk/media/base/videoengine_unittest.h

Issue 1327933003: Enable probing with repeated payload packets by default. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix additional tests. Created 5 years, 3 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 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 } 1043 }
1044 1044
1045 // Tests setting up and configuring a send stream. 1045 // Tests setting up and configuring a send stream.
1046 void AddRemoveSendStreams() { 1046 void AddRemoveSendStreams() {
1047 EXPECT_TRUE(SetOneCodec(DefaultCodec())); 1047 EXPECT_TRUE(SetOneCodec(DefaultCodec()));
1048 EXPECT_TRUE(SetSend(true)); 1048 EXPECT_TRUE(SetSend(true));
1049 EXPECT_TRUE(channel_->SetRender(true)); 1049 EXPECT_TRUE(channel_->SetRender(true));
1050 EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_)); 1050 EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
1051 EXPECT_TRUE(SendFrame()); 1051 EXPECT_TRUE(SendFrame());
1052 EXPECT_FRAME_WAIT(1, DefaultCodec().width, DefaultCodec().height, kTimeout); 1052 EXPECT_FRAME_WAIT(1, DefaultCodec().width, DefaultCodec().height, kTimeout);
1053 EXPECT_GE(2, NumRtpPackets()); 1053 EXPECT_GT(NumRtpPackets(), 0);
mflodman 2015/09/08 12:33:50 Why this change?
stefan-webrtc 2015/09/08 13:17:34 It's no longer true that you only get 2 packets. T
mflodman 2015/09/08 18:32:03 It used to be '>= 2', not '==', and now it's '> 0'
stefan-webrtc 2015/09/09 09:20:53 Oh, good point. I think I changed it by mistake. O
stefan-webrtc 2015/09/09 09:22:59 Sorry, I forgot why I change this. Notice that pre
1054 uint32 ssrc = 0; 1054 uint32 ssrc = 0;
1055 size_t last_packet = NumRtpPackets() - 1; 1055 size_t last_packet = NumRtpPackets() - 1;
1056 rtc::scoped_ptr<const rtc::Buffer> 1056 rtc::scoped_ptr<const rtc::Buffer>
1057 p(GetRtpPacket(static_cast<int>(last_packet))); 1057 p(GetRtpPacket(static_cast<int>(last_packet)));
1058 ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL); 1058 ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL);
1059 EXPECT_EQ(kSsrc, ssrc); 1059 EXPECT_EQ(kSsrc, ssrc);
1060 1060
1061 // Remove the send stream that was added during Setup. 1061 // Remove the send stream that was added during Setup.
1062 EXPECT_TRUE(channel_->RemoveSendStream(kSsrc)); 1062 EXPECT_TRUE(channel_->RemoveSendStream(kSsrc));
1063 int rtp_packets = NumRtpPackets(); 1063 int rtp_packets = NumRtpPackets();
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 1711
1712 // Two streams one channel tests. 1712 // Two streams one channel tests.
1713 1713
1714 // Tests that we can send and receive frames. 1714 // Tests that we can send and receive frames.
1715 void TwoStreamsSendAndReceive(const cricket::VideoCodec& codec) { 1715 void TwoStreamsSendAndReceive(const cricket::VideoCodec& codec) {
1716 SetUpSecondStream(); 1716 SetUpSecondStream();
1717 // Test sending and receiving on first stream. 1717 // Test sending and receiving on first stream.
1718 SendAndReceive(codec); 1718 SendAndReceive(codec);
1719 // Test sending and receiving on second stream. 1719 // Test sending and receiving on second stream.
1720 EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout); 1720 EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout);
1721 EXPECT_EQ(2, NumRtpPackets()); 1721 EXPECT_GT(NumRtpPackets(), 0);
1722 EXPECT_EQ(1, renderer2_.num_rendered_frames()); 1722 EXPECT_EQ(1, renderer2_.num_rendered_frames());
1723 } 1723 }
1724 1724
1725 // Set up 2 streams where the first stream uses the default channel. 1725 // Set up 2 streams where the first stream uses the default channel.
1726 // Then disconnect the first stream and verify default channel becomes 1726 // Then disconnect the first stream and verify default channel becomes
1727 // available. 1727 // available.
1728 // Then add a new stream with |new_ssrc|. The new stream should re-use the 1728 // Then add a new stream with |new_ssrc|. The new stream should re-use the
1729 // default channel. 1729 // default channel.
1730 void TwoStreamsReUseFirstStream(const cricket::VideoCodec& codec) { 1730 void TwoStreamsReUseFirstStream(const cricket::VideoCodec& codec) {
1731 SetUpSecondStream(); 1731 SetUpSecondStream();
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 rtc::scoped_ptr<C> channel_; 1880 rtc::scoped_ptr<C> channel_;
1881 cricket::FakeNetworkInterface network_interface_; 1881 cricket::FakeNetworkInterface network_interface_;
1882 cricket::FakeVideoRenderer renderer_; 1882 cricket::FakeVideoRenderer renderer_;
1883 cricket::VideoMediaChannel::Error media_error_; 1883 cricket::VideoMediaChannel::Error media_error_;
1884 1884
1885 // Used by test cases where 2 streams are run on the same channel. 1885 // Used by test cases where 2 streams are run on the same channel.
1886 cricket::FakeVideoRenderer renderer2_; 1886 cricket::FakeVideoRenderer renderer2_;
1887 }; 1887 };
1888 1888
1889 #endif // TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT 1889 #endif // TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/pacing/include/paced_sender.h » ('j') | webrtc/modules/rtp_rtcp/source/rtp_sender.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698