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

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

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: fixes content_browsertests and content_unittests Created 3 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
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 "content/browser/renderer_host/media/media_stream_dispatcher_host.h" 5 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <memory> 8 #include <memory>
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 for (size_t i = 0; i < devices.size(); ++i) { 420 for (size_t i = 0; i < devices.size(); ++i) {
421 if (!devices[i].device.name.empty()) 421 if (!devices[i].device.name.empty())
422 return false; 422 return false;
423 } 423 }
424 return true; 424 return true;
425 } 425 }
426 426
427 scoped_refptr<MockMediaStreamDispatcherHost> host_; 427 scoped_refptr<MockMediaStreamDispatcherHost> host_;
428 std::unique_ptr<MediaStreamManager> media_stream_manager_; 428 std::unique_ptr<MediaStreamManager> media_stream_manager_;
429 content::TestBrowserThreadBundle thread_bundle_; 429 content::TestBrowserThreadBundle thread_bundle_;
430 std::unique_ptr<media::AudioManager, media::AudioManagerDeleter> 430 std::unique_ptr<media::AudioManager> audio_manager_;
431 audio_manager_;
432 std::unique_ptr<media::AudioSystem> audio_system_; 431 std::unique_ptr<media::AudioSystem> audio_system_;
433 MockMediaStreamUIProxy* stream_ui_; 432 MockMediaStreamUIProxy* stream_ui_;
434 ContentBrowserClient* old_browser_client_; 433 ContentBrowserClient* old_browser_client_;
435 std::unique_ptr<ContentClient> content_client_; 434 std::unique_ptr<ContentClient> content_client_;
436 content::TestBrowserContext browser_context_; 435 content::TestBrowserContext browser_context_;
437 media::AudioDeviceDescriptions physical_audio_devices_; 436 media::AudioDeviceDescriptions physical_audio_devices_;
438 media::VideoCaptureDeviceDescriptors physical_video_devices_; 437 media::VideoCaptureDeviceDescriptors physical_video_devices_;
439 url::Origin origin_; 438 url::Origin origin_;
440 media::FakeVideoCaptureDeviceFactory* video_capture_device_factory_; 439 media::FakeVideoCaptureDeviceFactory* video_capture_device_factory_;
441 }; 440 };
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 base::RunLoop run_loop; 852 base::RunLoop run_loop;
854 EXPECT_CALL(*host_.get(), OnDeviceStopped(kRenderId)) 853 EXPECT_CALL(*host_.get(), OnDeviceStopped(kRenderId))
855 .WillOnce(testing::InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 854 .WillOnce(testing::InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
856 media_stream_manager_->media_devices_manager()->OnDevicesChanged( 855 media_stream_manager_->media_devices_manager()->OnDevicesChanged(
857 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); 856 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE);
858 857
859 run_loop.Run(); 858 run_loop.Run();
860 } 859 }
861 860
862 }; // namespace content 861 }; // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698