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

Unified Diff: content/renderer/media/video_capture_message_filter_unittest.cc

Issue 2409893003: VideoCapture: more migration IPC-->mojo, part 5 (Closed)
Patch Set: rebase content/common/BUILD.gn Created 4 years, 2 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
« no previous file with comments | « content/renderer/media/video_capture_message_filter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/video_capture_message_filter_unittest.cc
diff --git a/content/renderer/media/video_capture_message_filter_unittest.cc b/content/renderer/media/video_capture_message_filter_unittest.cc
index 5c1bbf0b664100d7080143344161c22639ccc13d..b8a9b36726cff7fe4e6a17a41f65c1f360d0d769 100644
--- a/content/renderer/media/video_capture_message_filter_unittest.cc
+++ b/content/renderer/media/video_capture_message_filter_unittest.cc
@@ -36,7 +36,6 @@ class MockVideoCaptureDelegate : public VideoCaptureMessageFilter::Delegate {
void(base::SharedMemoryHandle handle,
int length,
int buffer_id));
- MOCK_METHOD1(OnBufferDestroyed, void(int buffer_id));
MOCK_METHOD7(OnBufferReceived,
void(int buffer_id,
base::TimeDelta timestamp,
@@ -58,16 +57,6 @@ class MockVideoCaptureDelegate : public VideoCaptureMessageFilter::Delegate {
int device_id_;
};
-void ExpectMetadataContainsFooBarBaz(const base::DictionaryValue& metadata) {
- std::string value;
- if (metadata.GetString("foo", &value))
- EXPECT_EQ(std::string("bar"), value);
- else if (metadata.GetString("bar", &value))
- EXPECT_EQ(std::string("baz"), value);
- else
- FAIL() << "Missing key 'foo' or key 'bar'.";
-}
-
} // namespace
TEST(VideoCaptureMessageFilterTest, Basic) {
@@ -102,35 +91,6 @@ TEST(VideoCaptureMessageFilterTest, Basic) {
filter->OnMessageReceived(VideoCaptureMsg_NewBuffer(
delegate.device_id(), handle, 100, 1));
Mock::VerifyAndClearExpectations(&delegate);
- // VideoCaptureMsg_BufferReady
- VideoCaptureMsg_BufferReady_Params params;
- params.device_id = delegate.device_id();
- params.buffer_id = 22;
- params.timestamp = base::TimeDelta::FromMicroseconds(1);
- params.metadata.SetString("foo", "bar");
- media::VideoFrameMetadata frame_metadata;
- frame_metadata.SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME,
- base::TimeTicks::FromInternalValue(1));
- frame_metadata.MergeInternalValuesInto(&params.metadata);
- params.pixel_format = media::PIXEL_FORMAT_I420;
- params.storage_type = media::VideoFrame::STORAGE_SHMEM;
- params.coded_size = gfx::Size(234, 512);
- params.visible_rect = gfx::Rect(100, 200, 300, 400);
-
- EXPECT_CALL(delegate,
- OnBufferReceived(params.buffer_id, params.timestamp, _,
- media::PIXEL_FORMAT_I420,
- media::VideoFrame::STORAGE_SHMEM,
- params.coded_size, params.visible_rect))
- .WillRepeatedly(WithArg<2>(Invoke(&ExpectMetadataContainsFooBarBaz)));
- filter->OnMessageReceived(VideoCaptureMsg_BufferReady(params));
- Mock::VerifyAndClearExpectations(&delegate);
-
- // VideoCaptureMsg_FreeBuffer
- EXPECT_CALL(delegate, OnBufferDestroyed(params.buffer_id));
- filter->OnMessageReceived(VideoCaptureMsg_FreeBuffer(
- delegate.device_id(), params.buffer_id));
- Mock::VerifyAndClearExpectations(&delegate);
}
TEST(VideoCaptureMessageFilterTest, Delegates) {
« no previous file with comments | « content/renderer/media/video_capture_message_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698