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

Side by Side Diff: content/renderer/media/user_media_client_impl_unittest.cc

Issue 937293002: Unify request failure handling in content::UserMediaClientImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed remaining breaks + updated unit test code Created 5 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 unified diff | Download patch
« no previous file with comments | « content/renderer/media/user_media_client_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/child/child_process.h" 8 #include "content/child/child_process.h"
9 #include "content/renderer/media/media_stream.h" 9 #include "content/renderer/media/media_stream.h"
10 #include "content/renderer/media/media_stream_track.h" 10 #include "content/renderer/media/media_stream_track.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 void GetUserMediaRequestSucceeded( 78 void GetUserMediaRequestSucceeded(
79 const blink::WebMediaStream& stream, 79 const blink::WebMediaStream& stream,
80 blink::WebUserMediaRequest* request_info) override { 80 blink::WebUserMediaRequest* request_info) override {
81 last_generated_stream_ = stream; 81 last_generated_stream_ = stream;
82 state_ = REQUEST_SUCCEEDED; 82 state_ = REQUEST_SUCCEEDED;
83 } 83 }
84 84
85 void GetUserMediaRequestFailed( 85 void GetUserMediaRequestFailed(
86 blink::WebUserMediaRequest* request_info, 86 blink::WebUserMediaRequest* request_info,
87 content::MediaStreamRequestResult result) override { 87 content::MediaStreamRequestResult result,
88 last_generated_stream_.reset();
89 state_ = REQUEST_FAILED;
90 result_ = result;
91 }
92
93 void GetUserMediaRequestTrackStartedFailed(
94 blink::WebUserMediaRequest* request_info,
95 MediaStreamRequestResult result,
96 const blink::WebString& result_name) override { 88 const blink::WebString& result_name) override {
97 last_generated_stream_.reset(); 89 last_generated_stream_.reset();
98 state_ = REQUEST_FAILED; 90 state_ = REQUEST_FAILED;
99 result_ = result; 91 result_ = result;
100 result_name_ = result_name; 92 result_name_ = result_name;
101 } 93 }
102 94
103 void EnumerateDevicesSucceded( 95 void EnumerateDevicesSucceded(
104 blink::WebMediaDevicesRequest* request, 96 blink::WebMediaDevicesRequest* request,
105 blink::WebVector<blink::WebMediaDeviceInfo>& devices) override { 97 blink::WebVector<blink::WebMediaDeviceInfo>& devices) override {
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 563
572 // Video input device environment facing. 564 // Video input device environment facing.
573 source = &used_media_impl_->last_sources()[3]; 565 source = &used_media_impl_->last_sources()[3];
574 EXPECT_FALSE(source->id().isEmpty()); 566 EXPECT_FALSE(source->id().isEmpty());
575 EXPECT_EQ(blink::WebSourceInfo::SourceKindVideo, source->kind()); 567 EXPECT_EQ(blink::WebSourceInfo::SourceKindVideo, source->kind());
576 EXPECT_FALSE(source->label().isEmpty()); 568 EXPECT_FALSE(source->label().isEmpty());
577 EXPECT_EQ(blink::WebSourceInfo::VideoFacingModeEnvironment, source->facing()); 569 EXPECT_EQ(blink::WebSourceInfo::VideoFacingModeEnvironment, source->facing());
578 } 570 }
579 571
580 } // namespace content 572 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/user_media_client_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698