| Index: webrtc/modules/video_coding/frame_buffer2_unittest.cc
|
| diff --git a/webrtc/modules/video_coding/frame_buffer2_unittest.cc b/webrtc/modules/video_coding/frame_buffer2_unittest.cc
|
| index 67706ce05819b51ec8fc6befeea2ac374c23dd9f..cc1703a4db3332fe275ea374aad6eaa902c9ecb5 100644
|
| --- a/webrtc/modules/video_coding/frame_buffer2_unittest.cc
|
| +++ b/webrtc/modules/video_coding/frame_buffer2_unittest.cc
|
| @@ -185,16 +185,15 @@ class TestFrameBuffer2 : public ::testing::Test {
|
| rtc::CriticalSection crit_;
|
| };
|
|
|
| -TEST_F(TestFrameBuffer2, ExtractFromEmptyBuffer) {
|
| - ExtractFrame();
|
| - CheckNoFrame(0);
|
| -}
|
| -
|
| +// Following tests are timing dependent. Either the timeouts have to
|
| +// be increased by a large margin, which would slow down all trybots,
|
| +// or we disable them for the very slow ones, like we do here.
|
| +#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER)
|
| TEST_F(TestFrameBuffer2, WaitForFrame) {
|
| uint16_t pid = Rand();
|
| uint32_t ts = Rand();
|
|
|
| - ExtractFrame(20);
|
| + ExtractFrame(50);
|
| InsertFrame(pid, 0, ts, false);
|
| CheckFrame(0, pid, 0);
|
| }
|
| @@ -203,7 +202,7 @@ TEST_F(TestFrameBuffer2, OneSuperFrame) {
|
| uint16_t pid = Rand();
|
| uint32_t ts = Rand();
|
|
|
| - ExtractFrame(20);
|
| + ExtractFrame(50);
|
| InsertFrame(pid, 1, ts, true);
|
| InsertFrame(pid, 0, ts, false);
|
| ExtractFrame();
|
| @@ -212,37 +211,43 @@ TEST_F(TestFrameBuffer2, OneSuperFrame) {
|
| CheckFrame(1, pid, 1);
|
| }
|
|
|
| -TEST_F(TestFrameBuffer2, OneLayerStream) {
|
| +TEST_F(TestFrameBuffer2, OneLayerStreamReordered) {
|
| uint16_t pid = Rand();
|
| uint32_t ts = Rand();
|
|
|
| InsertFrame(pid, 0, ts, false);
|
| ExtractFrame();
|
| CheckFrame(0, pid, 0);
|
| - for (int i = 1; i < 10; ++i) {
|
| + for (int i = 1; i < 10; i += 2) {
|
| + ExtractFrame(50);
|
| + InsertFrame(pid + i + 1, 0, ts + (i + 1) * kFps10, false, pid + i);
|
| + clock_.AdvanceTimeMilliseconds(kFps10);
|
| InsertFrame(pid + i, 0, ts + i * kFps10, false, pid + i - 1);
|
| - ExtractFrame();
|
| clock_.AdvanceTimeMilliseconds(kFps10);
|
| + ExtractFrame();
|
| CheckFrame(i, pid + i, 0);
|
| + CheckFrame(i + 1, pid + i + 1, 0);
|
| }
|
| }
|
| +#endif // Timing dependent tests.
|
|
|
| -TEST_F(TestFrameBuffer2, OneLayerStreamReordered) {
|
| +TEST_F(TestFrameBuffer2, ExtractFromEmptyBuffer) {
|
| + ExtractFrame();
|
| + CheckNoFrame(0);
|
| +}
|
| +
|
| +TEST_F(TestFrameBuffer2, OneLayerStream) {
|
| uint16_t pid = Rand();
|
| uint32_t ts = Rand();
|
|
|
| InsertFrame(pid, 0, ts, false);
|
| ExtractFrame();
|
| CheckFrame(0, pid, 0);
|
| - for (int i = 1; i < 10; i += 2) {
|
| - ExtractFrame(15);
|
| - InsertFrame(pid + i + 1, 0, ts + (i + 1) * kFps10, false, pid + i);
|
| - clock_.AdvanceTimeMilliseconds(kFps10);
|
| + for (int i = 1; i < 10; ++i) {
|
| InsertFrame(pid + i, 0, ts + i * kFps10, false, pid + i - 1);
|
| - clock_.AdvanceTimeMilliseconds(kFps10);
|
| ExtractFrame();
|
| + clock_.AdvanceTimeMilliseconds(kFps10);
|
| CheckFrame(i, pid + i, 0);
|
| - CheckFrame(i + 1, pid + i + 1, 0);
|
| }
|
| }
|
|
|
|
|