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

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

Issue 2673373003: getUserMeida: report device starting states (Closed)
Patch Set: address comments on PS#7 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_aura_unittest.cc
diff --git a/content/browser/media/capture/desktop_capture_device_aura_unittest.cc b/content/browser/media/capture/desktop_capture_device_aura_unittest.cc
index 8f183081fd5583e1d8267d513767cbfcc1125569..ae552f79607fe44333f189d11fa764754e17477e 100644
--- a/content/browser/media/capture/desktop_capture_device_aura_unittest.cc
+++ b/content/browser/media/capture/desktop_capture_device_aura_unittest.cc
@@ -25,6 +25,7 @@
using ::testing::_;
using ::testing::AnyNumber;
+using ::testing::AtMost;
using ::testing::DoAll;
using ::testing::Expectation;
using ::testing::InvokeWithoutArgs;
@@ -56,6 +57,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,
@@ -155,6 +157,9 @@ TEST_F(DesktopCaptureDeviceAuraTest, StartAndStop) {
std::unique_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_, _)).Times(0);
+ // |STARTED| is reported asynchronously, which may not be got if capture
+ // is stopped immediately.
+ EXPECT_CALL(*client, OnStarted()).Times(AtMost(1));
media::VideoCaptureParams capture_params;
capture_params.requested_format.frame_size.SetSize(640, 480);

Powered by Google App Engine
This is Rietveld 408576698