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

Side by Side Diff: content/browser/renderer_host/media/media_stream_dispatcher_host_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 unified diff | Download patch | Annotate | Revision Log
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 <string> 5 #include <string>
6 #include <queue> 6 #include <queue>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // Notify that the event have occurred. 141 // Notify that the event have occurred.
142 base::Closure quit_closure = quit_closures_.front(); 142 base::Closure quit_closure = quit_closures_.front();
143 quit_closures_.pop(); 143 quit_closures_.pop();
144 message_loop_->PostTask(FROM_HERE, base::ResetAndReturn(&quit_closure)); 144 message_loop_->PostTask(FROM_HERE, base::ResetAndReturn(&quit_closure));
145 145
146 label_ = label; 146 label_ = label;
147 audio_devices_ = audio_device_list; 147 audio_devices_ = audio_device_list;
148 video_devices_ = video_device_list; 148 video_devices_ = video_device_list;
149 } 149 }
150 150
151 void OnStreamGenerationFailed(const IPC::Message& msg, int request_id) { 151 void OnStreamGenerationFailed(
152 const IPC::Message& msg,
153 int request_id,
154 content::MediaStreamRequestResult result) {
152 OnStreamGenerationFailed(msg.routing_id(), request_id); 155 OnStreamGenerationFailed(msg.routing_id(), request_id);
Tom Sepez 2014/03/06 18:36:26 nit: maybe pass |result| as well so it can be chec
Tommy Widenflycht 2014/03/07 11:50:05 Done.
153 if (!quit_closures_.empty()) { 156 if (!quit_closures_.empty()) {
154 base::Closure quit_closure = quit_closures_.front(); 157 base::Closure quit_closure = quit_closures_.front();
155 quit_closures_.pop(); 158 quit_closures_.pop();
156 message_loop_->PostTask(FROM_HERE, base::ResetAndReturn(&quit_closure)); 159 message_loop_->PostTask(FROM_HERE, base::ResetAndReturn(&quit_closure));
157 } 160 }
158 161
159 label_= ""; 162 label_= "";
160 } 163 }
161 164
162 void OnDeviceStopped(const IPC::Message& msg, 165 void OnDeviceStopped(const IPC::Message& msg,
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, 827 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId,
825 MEDIA_DEVICE_AUDIO_CAPTURE); 828 MEDIA_DEVICE_AUDIO_CAPTURE);
826 } 829 }
827 830
828 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevices) { 831 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevices) {
829 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, 832 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId,
830 MEDIA_DEVICE_VIDEO_CAPTURE); 833 MEDIA_DEVICE_VIDEO_CAPTURE);
831 } 834 }
832 835
833 }; // namespace content 836 }; // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698