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

Side by Side Diff: content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc

Issue 9369009: Make content::ResourceContext be a real interface like the rest of the Content API (i.e. don't ha... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "content/browser/browser_thread_impl.h" 9 #include "content/browser/browser_thread_impl.h"
10 #include "content/browser/mock_resource_context.h" 10 #include "content/browser/mock_resource_context.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 host_->OnGenerateStream(kPageRequestId, options); 296 host_->OnGenerateStream(kPageRequestId, options);
297 WaitForResult(); 297 WaitForResult();
298 std::string label = host_->label_; 298 std::string label = host_->label_;
299 299
300 EXPECT_EQ(host_->audio_devices_.size(), 0u); 300 EXPECT_EQ(host_->audio_devices_.size(), 0u);
301 EXPECT_EQ(host_->video_devices_.size(), 1u); 301 EXPECT_EQ(host_->video_devices_.size(), 1u);
302 EXPECT_EQ(host_->NumberOfStreams(), 1u); 302 EXPECT_EQ(host_->NumberOfStreams(), 1u);
303 303
304 EXPECT_CALL(*host_, OnVideoDeviceFailed(kRenderId, 0)); 304 EXPECT_CALL(*host_, OnVideoDeviceFailed(kRenderId, 0));
305 int session_id = host_->video_devices_[0].session_id; 305 int session_id = host_->video_devices_[0].session_id;
306 content::MockResourceContext::GetInstance()->media_stream_manager()-> 306 content::MockResourceContext::GetInstance()->GetMediaStreamManager()->
307 video_capture_manager()->Error(session_id); 307 video_capture_manager()->Error(session_id);
308 WaitForResult(); 308 WaitForResult();
309 EXPECT_EQ(host_->video_devices_.size(), 0u); 309 EXPECT_EQ(host_->video_devices_.size(), 0u);
310 EXPECT_EQ(host_->NumberOfStreams(), 1u); 310 EXPECT_EQ(host_->NumberOfStreams(), 1u);
311 311
312 // TODO(perkj): test audio device failure? 312 // TODO(perkj): test audio device failure?
313 313
314 host_->OnStopGeneratedStream(label); 314 host_->OnStopGeneratedStream(label);
315 EXPECT_EQ(host_->NumberOfStreams(), 0u); 315 EXPECT_EQ(host_->NumberOfStreams(), 0u);
316 } 316 }
317 317
318 }; // namespace media_stream 318 }; // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698