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

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

Issue 2518143004: [Mojo Video Capture] Replace RESOURCE_UTILIZATION with interface ReceiverLoadObserver (Closed)
Patch Set: Fixes for failing bots Created 4 years, 1 month 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 da791c2e4371785c07f367a629908d15157dfb82..60b896f6a116fa264dcff544425d61b46743a793 100644
--- a/content/browser/media/capture/desktop_capture_device_unittest.cc
+++ b/content/browser/media/capture/desktop_capture_device_unittest.cc
@@ -60,13 +60,14 @@ const uint8_t kFakePixelValueFirst = 2;
class MockDeviceClient : public media::VideoCaptureDevice::Client {
public:
- MOCK_METHOD6(OnIncomingCapturedData,
+ MOCK_METHOD7(OnIncomingCapturedData,
void(const uint8_t* data,
int length,
const media::VideoCaptureFormat& frame_format,
int rotation,
base::TimeTicks reference_time,
- base::TimeDelta timestamp));
+ base::TimeDelta timestamp,
+ int frame_id));
MOCK_METHOD0(DoReserveOutputBuffer, void(void));
MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void));
MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void));
@@ -86,14 +87,16 @@ class MockDeviceClient : public media::VideoCaptureDevice::Client {
return std::unique_ptr<Buffer>();
}
void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
- const media::VideoCaptureFormat& frame_format,
- base::TimeTicks reference_time,
- base::TimeDelta timestamp) override {
+ const media::VideoCaptureFormat& format,
+ base::TimeTicks reference_time,
+ base::TimeDelta timestamp,
+ int frame_id) override {
DoOnIncomingCapturedBuffer();
}
void OnIncomingCapturedVideoFrame(
std::unique_ptr<Buffer> buffer,
- scoped_refptr<media::VideoFrame> frame) override {
+ scoped_refptr<media::VideoFrame> frame,
+ int frame_id) override {
DoOnIncomingCapturedVideoFrame();
}
std::unique_ptr<Buffer> ResurrectLastOutputBuffer(
@@ -264,7 +267,8 @@ class DesktopCaptureDeviceTest : public testing::Test {
const media::VideoCaptureFormat&,
int,
base::TimeTicks,
- base::TimeDelta) {
+ base::TimeDelta,
+ int) {
ASSERT_TRUE(output_frame_);
ASSERT_EQ(output_frame_->stride() * output_frame_->size().height(), size);
memcpy(output_frame_->data(), frame, size);
@@ -297,7 +301,7 @@ TEST_F(DesktopCaptureDeviceTest, MAYBE_Capture) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_, _)).Times(0);
- EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _))
+ EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(SaveArg<1>(&frame_size), SaveArg<2>(&format),
InvokeWithoutArgs(&done_event, &base::WaitableEvent::Signal)));
@@ -334,7 +338,7 @@ TEST_F(DesktopCaptureDeviceTest, ScreenResolutionChangeConstantResolution) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_, _)).Times(0);
- EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _))
+ EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(WithArg<2>(Invoke(&format_checker,
&FormatChecker::ExpectAcceptableSize)),
@@ -378,7 +382,7 @@ TEST_F(DesktopCaptureDeviceTest, ScreenResolutionChangeFixedAspectRatio) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_,_)).Times(0);
- EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _))
+ EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(WithArg<2>(Invoke(&format_checker,
&FormatChecker::ExpectAcceptableSize)),
@@ -426,7 +430,7 @@ TEST_F(DesktopCaptureDeviceTest, ScreenResolutionChangeVariableResolution) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_,_)).Times(0);
- EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _))
+ EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(WithArg<2>(Invoke(&format_checker,
&FormatChecker::ExpectAcceptableSize)),
@@ -476,7 +480,7 @@ TEST_F(DesktopCaptureDeviceTest, UnpackedFrame) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_,_)).Times(0);
- EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _))
+ EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(Invoke(this, &DesktopCaptureDeviceTest::CopyFrame),
SaveArg<1>(&frame_size),
@@ -523,7 +527,7 @@ TEST_F(DesktopCaptureDeviceTest, InvertedFrame) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_,_)).Times(0);
- EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _))
+ EXPECT_CALL(*client, OnIncomingCapturedData(_, _, _, _, _, _, _))
.WillRepeatedly(
DoAll(Invoke(this, &DesktopCaptureDeviceTest::CopyFrame),
SaveArg<1>(&frame_size),

Powered by Google App Engine
This is Rietveld 408576698