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

Unified Diff: content/browser/media/capture/desktop_capture_device_unittest.cc

Issue 2673373003: getUserMeida: report device starting states (Closed)
Patch Set: address comments on PS#3 Created 3 years, 10 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/media/capture/desktop_capture_device_unittest.cc
diff --git a/content/browser/media/capture/desktop_capture_device_unittest.cc b/content/browser/media/capture/desktop_capture_device_unittest.cc
index 4885ee2f4e825101f23db3b8194719efc79868b2..9edd24adabe7272a927df64bf0711f694662ceeb 100644
--- a/content/browser/media/capture/desktop_capture_device_unittest.cc
+++ b/content/browser/media/capture/desktop_capture_device_unittest.cc
@@ -75,6 +75,7 @@ class MockDeviceClient : public media::VideoCaptureDevice::Client {
MOCK_METHOD2(OnError,
void(const tracked_objects::Location& from_here,
const std::string& reason));
+ MOCK_METHOD0(OnStarted, void(void));
// Trampoline methods to workaround GMOCK problems with std::unique_ptr<>.
Buffer ReserveOutputBuffer(const gfx::Size& dimensions,
@@ -303,6 +304,7 @@ TEST_F(DesktopCaptureDeviceTest, MAYBE_Capture) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_, _)).Times(0);
+ EXPECT_CALL(*client, OnStarted());
EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(SaveArg<1>(&frame_size), SaveArg<2>(&format),
@@ -340,6 +342,7 @@ TEST_F(DesktopCaptureDeviceTest, ScreenResolutionChangeConstantResolution) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_, _)).Times(0);
+ EXPECT_CALL(*client, OnStarted());
EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(WithArg<2>(Invoke(&format_checker,
@@ -384,6 +387,7 @@ TEST_F(DesktopCaptureDeviceTest, ScreenResolutionChangeFixedAspectRatio) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_,_)).Times(0);
+ EXPECT_CALL(*client, OnStarted());
EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(WithArg<2>(Invoke(&format_checker,
@@ -432,6 +436,7 @@ TEST_F(DesktopCaptureDeviceTest, ScreenResolutionChangeVariableResolution) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_,_)).Times(0);
+ EXPECT_CALL(*client, OnStarted());
EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(WithArg<2>(Invoke(&format_checker,
@@ -482,6 +487,7 @@ TEST_F(DesktopCaptureDeviceTest, UnpackedFrame) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_,_)).Times(0);
+ EXPECT_CALL(*client, OnStarted());
EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(Invoke(this, &DesktopCaptureDeviceTest::CopyFrame),
@@ -529,6 +535,7 @@ TEST_F(DesktopCaptureDeviceTest, InvertedFrame) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_,_)).Times(0);
+ EXPECT_CALL(*client, OnStarted());
EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(Invoke(this, &DesktopCaptureDeviceTest::CopyFrame),

Powered by Google App Engine
This is Rietveld 408576698