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

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

Issue 1994623003: Reduce flakyness of timing dependent tests for TestFrameBuffer2.*. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 TEST_F(TestFrameBuffer2, ExtractFromEmptyBuffer) { 188 TEST_F(TestFrameBuffer2, ExtractFromEmptyBuffer) {
189 ExtractFrame(); 189 ExtractFrame();
190 CheckNoFrame(0); 190 CheckNoFrame(0);
191 } 191 }
192 192
193 TEST_F(TestFrameBuffer2, WaitForFrame) { 193 TEST_F(TestFrameBuffer2, WaitForFrame) {
194 uint16_t pid = Rand(); 194 uint16_t pid = Rand();
195 uint32_t ts = Rand(); 195 uint32_t ts = Rand();
196 196
197 ExtractFrame(20); 197 ExtractFrame(50);
stefan-webrtc 2016/05/19 11:47:39 Maybe name these constants to make it more readabl
198 InsertFrame(pid, 0, ts, false); 198 InsertFrame(pid, 0, ts, false);
199 CheckFrame(0, pid, 0); 199 CheckFrame(0, pid, 0);
200 } 200 }
201 201
202 TEST_F(TestFrameBuffer2, OneSuperFrame) { 202 TEST_F(TestFrameBuffer2, OneSuperFrame) {
203 uint16_t pid = Rand(); 203 uint16_t pid = Rand();
204 uint32_t ts = Rand(); 204 uint32_t ts = Rand();
205 205
206 ExtractFrame(20); 206 ExtractFrame(50);
207 InsertFrame(pid, 1, ts, true); 207 InsertFrame(pid, 1, ts, true);
208 InsertFrame(pid, 0, ts, false); 208 InsertFrame(pid, 0, ts, false);
209 ExtractFrame(); 209 ExtractFrame();
210 210
211 CheckFrame(0, pid, 0); 211 CheckFrame(0, pid, 0);
212 CheckFrame(1, pid, 1); 212 CheckFrame(1, pid, 1);
213 } 213 }
214 214
215 TEST_F(TestFrameBuffer2, OneLayerStream) { 215 TEST_F(TestFrameBuffer2, OneLayerStream) {
216 uint16_t pid = Rand(); 216 uint16_t pid = Rand();
(...skipping 11 matching lines...) Expand all
228 } 228 }
229 229
230 TEST_F(TestFrameBuffer2, OneLayerStreamReordered) { 230 TEST_F(TestFrameBuffer2, OneLayerStreamReordered) {
231 uint16_t pid = Rand(); 231 uint16_t pid = Rand();
232 uint32_t ts = Rand(); 232 uint32_t ts = Rand();
233 233
234 InsertFrame(pid, 0, ts, false); 234 InsertFrame(pid, 0, ts, false);
235 ExtractFrame(); 235 ExtractFrame();
236 CheckFrame(0, pid, 0); 236 CheckFrame(0, pid, 0);
237 for (int i = 1; i < 10; i += 2) { 237 for (int i = 1; i < 10; i += 2) {
238 ExtractFrame(15); 238 ExtractFrame(50);
239 InsertFrame(pid + i + 1, 0, ts + (i + 1) * kFps10, false, pid + i); 239 InsertFrame(pid + i + 1, 0, ts + (i + 1) * kFps10, false, pid + i);
240 clock_.AdvanceTimeMilliseconds(kFps10); 240 clock_.AdvanceTimeMilliseconds(kFps10);
241 InsertFrame(pid + i, 0, ts + i * kFps10, false, pid + i - 1); 241 InsertFrame(pid + i, 0, ts + i * kFps10, false, pid + i - 1);
242 clock_.AdvanceTimeMilliseconds(kFps10); 242 clock_.AdvanceTimeMilliseconds(kFps10);
243 ExtractFrame(); 243 ExtractFrame();
244 CheckFrame(i, pid + i, 0); 244 CheckFrame(i, pid + i, 0);
245 CheckFrame(i + 1, pid + i + 1, 0); 245 CheckFrame(i + 1, pid + i + 1, 0);
246 } 246 }
247 } 247 }
248 248
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 InsertFrame(pid + 1, 0, ts, false, pid); 320 InsertFrame(pid + 1, 0, ts, false, pid);
321 ExtractFrame(); 321 ExtractFrame();
322 322
323 CheckFrame(0, pid, 0); 323 CheckFrame(0, pid, 0);
324 CheckFrame(1, pid + 2, 0); 324 CheckFrame(1, pid + 2, 0);
325 CheckNoFrame(2); 325 CheckNoFrame(2);
326 } 326 }
327 327
328 } // namespace video_coding 328 } // namespace video_coding
329 } // namespace webrtc 329 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698