OLD | NEW |
---|---|
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 | 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/renderer_host/media/audio_input_device_manager.h" | 10 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 content_client_->set_browser_for_testing(host_); | 193 content_client_->set_browser_for_testing(host_); |
194 } | 194 } |
195 | 195 |
196 virtual void TearDown() OVERRIDE { | 196 virtual void TearDown() OVERRIDE { |
197 message_loop_->RunAllPending(); | 197 message_loop_->RunAllPending(); |
198 | 198 |
199 // Recover the old browser client and content client. | 199 // Recover the old browser client and content client. |
200 content::GetContentClient()->set_browser_for_testing(old_browser_client_); | 200 content::GetContentClient()->set_browser_for_testing(old_browser_client_); |
201 content::SetContentClient(old_client_); | 201 content::SetContentClient(old_client_); |
202 content_client_.reset(); | 202 content_client_.reset(); |
203 | |
204 // Delete the IO message loop to delete the device thread and managers. | |
205 message_loop_.reset(); | |
tommi (sloooow) - chröme
2012/07/17 15:36:58
Did you have to add this explicitly? This doesn't
no longer working on chromium
2012/07/17 17:18:25
This deletes the device thread, AudioInputDeviceMa
| |
203 } | 206 } |
204 | 207 |
205 scoped_refptr<MockMediaStreamDispatcherHost> host_; | 208 scoped_refptr<MockMediaStreamDispatcherHost> host_; |
206 scoped_ptr<MessageLoop> message_loop_; | 209 scoped_ptr<MessageLoop> message_loop_; |
207 scoped_ptr<BrowserThreadImpl> io_thread_; | 210 scoped_ptr<BrowserThreadImpl> io_thread_; |
208 scoped_ptr<media::AudioManager> audio_manager_; | 211 scoped_ptr<media::AudioManager> audio_manager_; |
209 scoped_ptr<MediaStreamManager> media_stream_manager_; | 212 scoped_ptr<MediaStreamManager> media_stream_manager_; |
210 content::ContentClient* old_client_; | 213 content::ContentClient* old_client_; |
211 content::ContentBrowserClient* old_browser_client_; | 214 content::ContentBrowserClient* old_browser_client_; |
212 scoped_ptr<content::ContentClient> content_client_; | 215 scoped_ptr<content::ContentClient> content_client_; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
331 EXPECT_EQ(host_->video_devices_.size(), 0u); | 334 EXPECT_EQ(host_->video_devices_.size(), 0u); |
332 EXPECT_EQ(host_->NumberOfStreams(), 1u); | 335 EXPECT_EQ(host_->NumberOfStreams(), 1u); |
333 | 336 |
334 // TODO(perkj): test audio device failure? | 337 // TODO(perkj): test audio device failure? |
335 | 338 |
336 host_->OnStopGeneratedStream(label); | 339 host_->OnStopGeneratedStream(label); |
337 EXPECT_EQ(host_->NumberOfStreams(), 0u); | 340 EXPECT_EQ(host_->NumberOfStreams(), 0u); |
338 } | 341 } |
339 | 342 |
340 }; // namespace media_stream | 343 }; // namespace media_stream |
OLD | NEW |