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

Unified Diff: content/browser/renderer_host/media/video_capture_controller_unittest.cc

Issue 1826643003: Add frame refresh to VideoCaptureDevice, and buffer pool resurrection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE before commit Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/video_capture_controller_unittest.cc
diff --git a/content/browser/renderer_host/media/video_capture_controller_unittest.cc b/content/browser/renderer_host/media/video_capture_controller_unittest.cc
index 99e563f50a12e6333d0c9c7a72101e7a51cdb32f..cdd8c168a522bd8b4d7a0d8f107340544fa6aff7 100644
--- a/content/browser/renderer_host/media/video_capture_controller_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_controller_unittest.cc
@@ -331,6 +331,7 @@ TEST_F(VideoCaptureControllerTest, NormalCaptureMultipleClients) {
base::RunLoop().RunUntilIdle();
Mock::VerifyAndClearExpectations(client_a_.get());
Mock::VerifyAndClearExpectations(client_b_.get());
+
// Expect VideoCaptureController set the metadata in |video_frame| to hold a
// resource utilization of 0.5 (the largest of all reported values).
double resource_utilization_in_metadata = -1.0;
@@ -359,15 +360,27 @@ TEST_F(VideoCaptureControllerTest, NormalCaptureMultipleClients) {
base::TimeTicks());
// The buffer should be delivered to the clients in any order.
- EXPECT_CALL(*client_a_,
- DoI420BufferReady(client_a_route_1, capture_resolution))
- .Times(1);
- EXPECT_CALL(*client_b_,
- DoI420BufferReady(client_b_route_1, capture_resolution))
- .Times(1);
- EXPECT_CALL(*client_a_,
- DoI420BufferReady(client_a_route_2, capture_resolution))
- .Times(1);
+ {
+ InSequence s;
+ EXPECT_CALL(*client_a_, DoBufferCreated(client_a_route_1)).Times(1);
+ EXPECT_CALL(*client_a_,
+ DoI420BufferReady(client_a_route_1, capture_resolution))
+ .Times(1);
+ }
+ {
+ InSequence s;
+ EXPECT_CALL(*client_b_, DoBufferCreated(client_b_route_1)).Times(1);
+ EXPECT_CALL(*client_b_,
+ DoI420BufferReady(client_b_route_1, capture_resolution))
+ .Times(1);
+ }
+ {
+ InSequence s;
+ EXPECT_CALL(*client_a_, DoBufferCreated(client_a_route_2)).Times(1);
+ EXPECT_CALL(*client_a_,
+ DoI420BufferReady(client_a_route_2, capture_resolution))
+ .Times(1);
+ }
base::RunLoop().RunUntilIdle();
Mock::VerifyAndClearExpectations(client_a_.get());
Mock::VerifyAndClearExpectations(client_b_.get());
@@ -407,23 +420,24 @@ TEST_F(VideoCaptureControllerTest, NormalCaptureMultipleClients) {
media::PIXEL_FORMAT_I420,
media::PIXEL_STORAGE_CPU).get());
- // The new client needs to be told of 3 buffers; the old clients only 2.
+ // The new client needs to be notified of the creation of |kPoolSize| buffers;
+ // the old clients only |kPoolSize - 2|.
EXPECT_CALL(*client_b_, DoBufferCreated(client_b_route_2)).Times(kPoolSize);
EXPECT_CALL(*client_b_,
DoI420BufferReady(client_b_route_2, capture_resolution))
.Times(kPoolSize);
EXPECT_CALL(*client_a_, DoBufferCreated(client_a_route_1))
- .Times(kPoolSize - 1);
+ .Times(kPoolSize - 2);
EXPECT_CALL(*client_a_,
DoI420BufferReady(client_a_route_1, capture_resolution))
.Times(kPoolSize);
EXPECT_CALL(*client_a_, DoBufferCreated(client_a_route_2))
- .Times(kPoolSize - 1);
+ .Times(kPoolSize - 2);
EXPECT_CALL(*client_a_,
DoI420BufferReady(client_a_route_2, capture_resolution))
.Times(kPoolSize);
EXPECT_CALL(*client_b_, DoBufferCreated(client_b_route_1))
- .Times(kPoolSize - 1);
+ .Times(kPoolSize - 2);
EXPECT_CALL(*client_b_,
DoI420BufferReady(client_b_route_1, capture_resolution))
.Times(kPoolSize);

Powered by Google App Engine
This is Rietveld 408576698