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

Unified Diff: content/renderer/media/media_stream_impl_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
« no previous file with comments | « content/renderer/media/media_stream_impl.cc ('k') | content/renderer/pepper/pepper_media_device_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_impl_unittest.cc
diff --git a/content/renderer/media/media_stream_impl_unittest.cc b/content/renderer/media/media_stream_impl_unittest.cc
index 05ae9c061d0b677b1bce9fa19b0b2d7dab081dc8..16b464b6a12b16e16f7b91da3bb411ac1c49fff7 100644
--- a/content/renderer/media/media_stream_impl_unittest.cc
+++ b/content/renderer/media/media_stream_impl_unittest.cc
@@ -56,9 +56,10 @@ class MediaStreamImplUnderTest : public MediaStreamImpl {
virtual void CompleteGetUserMediaRequest(
const blink::WebMediaStream& stream,
blink::WebUserMediaRequest* request_info,
- bool request_succeeded) OVERRIDE {
+ content::MediaStreamRequestResult result) OVERRIDE {
last_generated_stream_ = stream;
- state_ = request_succeeded ? REQUEST_SUCCEEDED : REQUEST_FAILED;
+ result_ = result;
+ state_ = (result == MEDIA_DEVICE_OK ? REQUEST_SUCCEEDED : REQUEST_FAILED);
}
virtual blink::WebMediaStream GetMediaStream(
@@ -87,10 +88,12 @@ class MediaStreamImplUnderTest : public MediaStreamImpl {
}
RequestState request_state() const { return state_; }
+ content::MediaStreamRequestResult error_reason() const { return result_; }
private:
blink::WebMediaStream last_generated_stream_;
RequestState state_;
+ content::MediaStreamRequestResult result_;
MediaStreamDependencyFactory* factory_;
MockMediaStreamVideoCapturerSource* video_source_;
};
@@ -290,6 +293,8 @@ TEST_F(MediaStreamImplTest, MediaSourceFailToStart) {
FailToStartMockedVideoSource();
EXPECT_EQ(MediaStreamImplUnderTest::REQUEST_FAILED,
ms_impl_->request_state());
+ EXPECT_EQ(MEDIA_DEVICE_TRACK_START_FAILURE,
+ ms_impl_->error_reason());
EXPECT_EQ(1, ms_dispatcher_->request_stream_counter());
EXPECT_EQ(1, ms_dispatcher_->stop_audio_device_counter());
EXPECT_EQ(1, ms_dispatcher_->stop_video_device_counter());
« no previous file with comments | « content/renderer/media/media_stream_impl.cc ('k') | content/renderer/pepper/pepper_media_device_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698