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

Side by Side Diff: content/browser/renderer_host/media/media_devices_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_devices_dispatcher_host.h" 5 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <queue> 10 #include <queue>
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 281
282 // The order of these members is important on teardown: 282 // The order of these members is important on teardown:
283 // MediaDevicesDispatcherHost expects to be destroyed on the IO thread while 283 // MediaDevicesDispatcherHost expects to be destroyed on the IO thread while
284 // MediaStreamManager expects to be destroyed after the IO thread has been 284 // MediaStreamManager expects to be destroyed after the IO thread has been
285 // uninitialized. 285 // uninitialized.
286 std::unique_ptr<MediaStreamManager> media_stream_manager_; 286 std::unique_ptr<MediaStreamManager> media_stream_manager_;
287 content::TestBrowserThreadBundle thread_bundle_; 287 content::TestBrowserThreadBundle thread_bundle_;
288 std::unique_ptr<MediaDevicesDispatcherHost> host_; 288 std::unique_ptr<MediaDevicesDispatcherHost> host_;
289 289
290 std::unique_ptr<media::AudioManager, media::AudioManagerDeleter> 290 std::unique_ptr<media::AudioManager> audio_manager_;
291 audio_manager_;
292 std::unique_ptr<media::AudioSystem> audio_system_; 291 std::unique_ptr<media::AudioSystem> audio_system_;
293 content::TestBrowserContext browser_context_; 292 content::TestBrowserContext browser_context_;
294 MediaDeviceEnumeration physical_devices_; 293 MediaDeviceEnumeration physical_devices_;
295 url::Origin origin_; 294 url::Origin origin_;
296 295
297 std::vector<MediaDeviceInfoArray> enumerated_devices_; 296 std::vector<MediaDeviceInfoArray> enumerated_devices_;
298 }; 297 };
299 298
300 TEST_F(MediaDevicesDispatcherHostTest, EnumerateAudioInputDevices) { 299 TEST_F(MediaDevicesDispatcherHostTest, EnumerateAudioInputDevices) {
301 EnumerateDevicesAndWaitForResult(true, false, false); 300 EnumerateDevicesAndWaitForResult(true, false, false);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // On Windows, the underlying MediaStreamManager uses a separate thread for 381 // On Windows, the underlying MediaStreamManager uses a separate thread for
383 // video capture which must be flushed to guarantee that the callback bound to 382 // video capture which must be flushed to guarantee that the callback bound to
384 // GetVIdeoInputCapabilities above is invoked before the end of this test's 383 // GetVIdeoInputCapabilities above is invoked before the end of this test's
385 // body. 384 // body.
386 media_stream_manager_->FlushVideoCaptureThreadForTesting(); 385 media_stream_manager_->FlushVideoCaptureThreadForTesting();
387 base::RunLoop().RunUntilIdle(); 386 base::RunLoop().RunUntilIdle();
388 #endif 387 #endif
389 } 388 }
390 389
391 }; // namespace content 390 }; // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698