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

Side by Side Diff: webrtc/modules/video_coding/frame_buffer2_unittest.cc

Issue 2937243002: Validate references of frames inserted into FrameBuffer2. (Closed)
Patch Set: . Created 3 years, 6 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 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 EXPECT_EQ(41248, InsertFrame(41248, 0, 1, false)); 524 EXPECT_EQ(41248, InsertFrame(41248, 0, 1, false));
525 ExtractFrame(); 525 ExtractFrame();
526 } 526 }
527 527
528 TEST_F(TestFrameBuffer2, DuplicateFrames) { 528 TEST_F(TestFrameBuffer2, DuplicateFrames) {
529 EXPECT_EQ(22256, InsertFrame(22256, 0, 1, false)); 529 EXPECT_EQ(22256, InsertFrame(22256, 0, 1, false));
530 ExtractFrame(); 530 ExtractFrame();
531 EXPECT_EQ(22256, InsertFrame(22256, 0, 1, false)); 531 EXPECT_EQ(22256, InsertFrame(22256, 0, 1, false));
532 } 532 }
533 533
534 // TODO(philipel): implement more unittests related to invalid references.
535 TEST_F(TestFrameBuffer2, InvalidReferences) {
536 EXPECT_EQ(-1, InsertFrame(0, 0, 1000, false, 2));
537 EXPECT_EQ(1, InsertFrame(1, 0, 2000, false));
538 ExtractFrame();
539 EXPECT_EQ(2, InsertFrame(2, 0, 3000, false, 1));
540 }
541
534 } // namespace video_coding 542 } // namespace video_coding
535 } // namespace webrtc 543 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698