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/capturemanager_unittest.cc

Issue 1603423002: Simplify CaptureRenderAdapter. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Delete test of RemoveVideoRenderer return value Created 4 years, 11 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 | « talk/media/base/capturemanager.cc ('k') | talk/media/base/capturerenderadapter.h » ('j') | 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 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 TEST_F(CaptureManagerTest, InvalidAddingRemoving) { 98 TEST_F(CaptureManagerTest, InvalidAddingRemoving) {
99 EXPECT_FALSE(capture_manager_.StopVideoCapture(&video_capturer_, 99 EXPECT_FALSE(capture_manager_.StopVideoCapture(&video_capturer_,
100 cricket::VideoFormat())); 100 cricket::VideoFormat()));
101 EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_, 101 EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_,
102 format_vga_)); 102 format_vga_));
103 EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait); 103 EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait);
104 EXPECT_EQ(1, callback_count()); 104 EXPECT_EQ(1, callback_count());
105 EXPECT_FALSE(capture_manager_.AddVideoRenderer(&video_capturer_, NULL)); 105 EXPECT_FALSE(capture_manager_.AddVideoRenderer(&video_capturer_, NULL));
106 EXPECT_FALSE(capture_manager_.RemoveVideoRenderer(&video_capturer_,
107 &video_renderer_));
108 EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_, format_vga_)); 106 EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_, format_vga_));
109 } 107 }
110 108
111 // Valid use cases 109 // Valid use cases
112 TEST_F(CaptureManagerTest, KeepFirstResolutionHigh) { 110 TEST_F(CaptureManagerTest, KeepFirstResolutionHigh) {
113 EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_, 111 EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_,
114 format_vga_)); 112 format_vga_));
115 EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait); 113 EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait);
116 EXPECT_EQ(1, callback_count()); 114 EXPECT_EQ(1, callback_count());
117 EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_, 115 EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_,
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // Now request restart with qvga. 218 // Now request restart with qvga.
221 EXPECT_TRUE(capture_manager_.RestartVideoCapture( 219 EXPECT_TRUE(capture_manager_.RestartVideoCapture(
222 &video_capturer_, format_vga_, format_qvga_, 220 &video_capturer_, format_vga_, format_qvga_,
223 cricket::CaptureManager::kRequestRestart)); 221 cricket::CaptureManager::kRequestRestart));
224 EXPECT_TRUE(video_capturer_.CaptureFrame()); 222 EXPECT_TRUE(video_capturer_.CaptureFrame());
225 EXPECT_EQ(2, NumFramesRendered()); 223 EXPECT_EQ(2, NumFramesRendered());
226 EXPECT_TRUE(WasRenderedResolution(format_vga_)); 224 EXPECT_TRUE(WasRenderedResolution(format_vga_));
227 EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_, 225 EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_,
228 format_qvga_)); 226 format_qvga_));
229 } 227 }
OLDNEW
« no previous file with comments | « talk/media/base/capturemanager.cc ('k') | talk/media/base/capturerenderadapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698