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

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

Issue 2430313007: VideoCapture: remove last remnants of IPC (Closed)
Patch Set: rockot@ comment on using ChildThread 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') | content/renderer/render_thread_impl.cc » ('j') | 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
deleted file mode 100644
index 4c71c14e4609431990cd3af55f4863db25ce6e07..0000000000000000000000000000000000000000
--- a/content/renderer/media/video_capture_message_filter_unittest.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdint.h>
-
-#include "base/process/process_handle.h"
-#include "build/build_config.h"
-#include "content/renderer/media/video_capture_message_filter.h"
-#include "ipc/ipc_test_sink.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using ::testing::_;
-using ::testing::Invoke;
-using ::testing::Mock;
-using ::testing::StrictMock;
-using ::testing::WithArgs;
-
-namespace content {
-namespace {
-
-class MockVideoCaptureDelegate : public VideoCaptureMessageFilter::Delegate {
- public:
- MockVideoCaptureDelegate() : device_id_(0) {
- ON_CALL(*this, OnDelegateAdded(_))
- .WillByDefault(WithArgs<0>(
- Invoke(this, &MockVideoCaptureDelegate::DoOnDelegateAdded)));
- }
-
- MOCK_METHOD1(OnDelegateAdded, void(int32_t));
- void DoOnDelegateAdded(int32_t device_id) {
- ASSERT_NE(0, device_id);
- ASSERT_EQ(0, device_id_);
- device_id_ = device_id;
- }
- int device_id() { return device_id_; }
-
- private:
- int device_id_;
-};
-
-} // anonymous namespace
-
-TEST(VideoCaptureMessageFilterTest, Basic) {
- scoped_refptr<VideoCaptureMessageFilter> filter(
- new VideoCaptureMessageFilter());
-
- IPC::TestSink channel;
- filter->OnFilterAdded(&channel);
- MockVideoCaptureDelegate delegate;
-
- EXPECT_CALL(delegate, OnDelegateAdded(1));
- filter->AddDelegate(&delegate);
- ASSERT_EQ(1, delegate.device_id());
-
- Mock::VerifyAndClearExpectations(&delegate);
-}
-
-TEST(VideoCaptureMessageFilterTest, Delegates) {
- scoped_refptr<VideoCaptureMessageFilter> filter(
- new VideoCaptureMessageFilter());
-
- IPC::TestSink channel;
- filter->OnFilterAdded(&channel);
-
- MockVideoCaptureDelegate delegate1;
- MockVideoCaptureDelegate delegate2;
-
- EXPECT_CALL(delegate1, OnDelegateAdded(1));
- EXPECT_CALL(delegate2, OnDelegateAdded(2));
- filter->AddDelegate(&delegate1);
- filter->AddDelegate(&delegate2);
- ASSERT_EQ(1, delegate1.device_id());
- ASSERT_EQ(2, delegate2.device_id());
-
- // Remove the delegates. Make sure they won't get called.
- filter->RemoveDelegate(&delegate1);
- filter->RemoveDelegate(&delegate2);
-}
-
-} // namespace content
« no previous file with comments | « content/renderer/media/video_capture_message_filter.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698