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

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

Issue 1075833002: Delay completion of getUserMedia in UserMediaClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 void RequestSources() { 72 void RequestSources() {
73 blink::WebMediaStreamTrackSourcesRequest sources_request; 73 blink::WebMediaStreamTrackSourcesRequest sources_request;
74 state_ = REQUEST_NOT_COMPLETE; 74 state_ = REQUEST_NOT_COMPLETE;
75 requestSources(sources_request); 75 requestSources(sources_request);
76 } 76 }
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, 87 content::MediaStreamRequestResult result,
88 const blink::WebString& result_name) override { 88 const blink::WebString& result_name) override {
89 last_generated_stream_.reset(); 89 last_generated_stream_.reset();
90 state_ = REQUEST_FAILED; 90 state_ = REQUEST_FAILED;
91 result_ = result; 91 result_ = result;
92 result_name_ = result_name; 92 result_name_ = result_name;
93 } 93 }
94 94
95 void EnumerateDevicesSucceded( 95 void EnumerateDevicesSucceded(
96 blink::WebMediaDevicesRequest* request, 96 blink::WebMediaDevicesRequest* request,
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 563
564 // Video input device environment facing. 564 // Video input device environment facing.
565 source = &used_media_impl_->last_sources()[3]; 565 source = &used_media_impl_->last_sources()[3];
566 EXPECT_FALSE(source->id().isEmpty()); 566 EXPECT_FALSE(source->id().isEmpty());
567 EXPECT_EQ(blink::WebSourceInfo::SourceKindVideo, source->kind()); 567 EXPECT_EQ(blink::WebSourceInfo::SourceKindVideo, source->kind());
568 EXPECT_FALSE(source->label().isEmpty()); 568 EXPECT_FALSE(source->label().isEmpty());
569 EXPECT_EQ(blink::WebSourceInfo::VideoFacingModeEnvironment, source->facing()); 569 EXPECT_EQ(blink::WebSourceInfo::VideoFacingModeEnvironment, source->facing());
570 } 570 }
571 571
572 } // 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