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

Unified Diff: content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc

Issue 180633008: Add different error codes for getUserMedia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments Created 6 years, 9 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/renderer_host/media/media_stream_ui_proxy_unittest.cc
diff --git a/content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc b/content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc
index bff55c618ccec08b48fe9140be7a1c573d118f46..93b422f0844c9fdbea18b3bc6a16d614ef8566ec 100644
--- a/content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc
+++ b/content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc
@@ -38,8 +38,9 @@ class MockRenderViewHostDelegate : public RenderViewHostDelegate {
class MockResponseCallback {
public:
- MOCK_METHOD1(OnAccessRequestResponse,
- void(const MediaStreamDevices& devices));
+ MOCK_METHOD2(OnAccessRequestResponse,
+ void(const MediaStreamDevices& devices,
+ content::MediaStreamRequestResult result));
};
class MockMediaStreamUI : public MediaStreamUI {
@@ -107,10 +108,10 @@ TEST_F(MediaStreamUIProxyTest, Deny) {
ASSERT_FALSE(callback.is_null());
MediaStreamDevices devices;
- callback.Run(devices, scoped_ptr<MediaStreamUI>());
+ callback.Run(devices, MEDIA_DEVICE_OK, scoped_ptr<MediaStreamUI>());
MediaStreamDevices response;
- EXPECT_CALL(response_callback_, OnAccessRequestResponse(_))
+ EXPECT_CALL(response_callback_, OnAccessRequestResponse(_, _))
.WillOnce(SaveArg<0>(&response));
message_loop_.RunUntilIdle();
@@ -137,10 +138,10 @@ TEST_F(MediaStreamUIProxyTest, AcceptAndStart) {
MediaStreamDevice(MEDIA_DEVICE_AUDIO_CAPTURE, "Mic", "Mic"));
scoped_ptr<MockMediaStreamUI> ui(new MockMediaStreamUI());
EXPECT_CALL(*ui, OnStarted(_));
- callback.Run(devices, ui.PassAs<MediaStreamUI>());
+ callback.Run(devices, MEDIA_DEVICE_OK, ui.PassAs<MediaStreamUI>());
MediaStreamDevices response;
- EXPECT_CALL(response_callback_, OnAccessRequestResponse(_))
+ EXPECT_CALL(response_callback_, OnAccessRequestResponse(_, _))
.WillOnce(SaveArg<0>(&response));
message_loop_.RunUntilIdle();
@@ -170,7 +171,7 @@ TEST_F(MediaStreamUIProxyTest, DeleteBeforeAccepted) {
MediaStreamDevices devices;
scoped_ptr<MediaStreamUI> ui;
- callback.Run(devices, ui.Pass());
+ callback.Run(devices, MEDIA_DEVICE_OK, ui.Pass());
}
TEST_F(MediaStreamUIProxyTest, StopFromUI) {
@@ -196,10 +197,10 @@ TEST_F(MediaStreamUIProxyTest, StopFromUI) {
scoped_ptr<MockMediaStreamUI> ui(new MockMediaStreamUI());
EXPECT_CALL(*ui, OnStarted(_))
.WillOnce(SaveArg<0>(&stop_callback));
- callback.Run(devices, ui.PassAs<MediaStreamUI>());
+ callback.Run(devices, MEDIA_DEVICE_OK, ui.PassAs<MediaStreamUI>());
MediaStreamDevices response;
- EXPECT_CALL(response_callback_, OnAccessRequestResponse(_))
+ EXPECT_CALL(response_callback_, OnAccessRequestResponse(_, _))
.WillOnce(SaveArg<0>(&response));
message_loop_.RunUntilIdle();

Powered by Google App Engine
This is Rietveld 408576698