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

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

Issue 1892433002: Moving device description utils from AudioManager[Base] into AudioDeviceDescription; to be shared b… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 4 years, 7 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/renderer/media/audio_renderer_mixer_manager.h" 5 #include "content/renderer/media/audio_renderer_mixer_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "content/renderer/media/audio_device_factory.h" 12 #include "content/renderer/media/audio_device_factory.h"
13 #include "media/audio/audio_manager_base.h" 13 #include "media/audio/audio_device_description.h"
14 #include "media/base/audio_capturer_source.h" 14 #include "media/base/audio_capturer_source.h"
15 #include "media/base/audio_parameters.h" 15 #include "media/base/audio_parameters.h"
16 #include "media/base/audio_renderer_mixer.h" 16 #include "media/base/audio_renderer_mixer.h"
17 #include "media/base/audio_renderer_mixer_input.h" 17 #include "media/base/audio_renderer_mixer_input.h"
18 #include "media/base/fake_audio_render_callback.h" 18 #include "media/base/fake_audio_render_callback.h"
19 #include "media/base/mock_audio_renderer_sink.h" 19 #include "media/base/mock_audio_renderer_sink.h"
20 #include "testing/gmock/include/gmock/gmock.h" 20 #include "testing/gmock/include/gmock/gmock.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 #include "url/gurl.h" 22 #include "url/gurl.h"
23 23
24 namespace content { 24 namespace content {
25 25
26 static const int kBitsPerChannel = 16; 26 static const int kBitsPerChannel = 16;
27 static const int kSampleRate = 48000; 27 static const int kSampleRate = 48000;
28 static const int kBufferSize = 8192; 28 static const int kBufferSize = 8192;
29 static const media::ChannelLayout kChannelLayout = media::CHANNEL_LAYOUT_STEREO; 29 static const media::ChannelLayout kChannelLayout = media::CHANNEL_LAYOUT_STEREO;
30 static const media::ChannelLayout kAnotherChannelLayout = 30 static const media::ChannelLayout kAnotherChannelLayout =
31 media::CHANNEL_LAYOUT_2_1; 31 media::CHANNEL_LAYOUT_2_1;
32 static const char* const kDefaultDeviceId = 32 static const char* const kDefaultDeviceId =
33 media::AudioManagerBase::kDefaultDeviceId; 33 media::AudioDeviceDescription::kDefaultDeviceId;
34 static const char kAnotherDeviceId[] = "another-device-id"; 34 static const char kAnotherDeviceId[] = "another-device-id";
35 static const char kMatchedDeviceId[] = "matched-device-id"; 35 static const char kMatchedDeviceId[] = "matched-device-id";
36 static const char kNonexistentDeviceId[] = "nonexistent-device-id"; 36 static const char kNonexistentDeviceId[] = "nonexistent-device-id";
37 37
38 static const int kRenderFrameId = 124; 38 static const int kRenderFrameId = 124;
39 static const int kAnotherRenderFrameId = 678; 39 static const int kAnotherRenderFrameId = 678;
40 40
41 using media::AudioParameters; 41 using media::AudioParameters;
42 42
43 class AudioRendererMixerManagerTest : public testing::Test, 43 class AudioRendererMixerManagerTest : public testing::Test,
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 EXPECT_CALL(*mock_sink_no_device_.get(), Stop()); 442 EXPECT_CALL(*mock_sink_no_device_.get(), Stop());
443 media::AudioRendererMixer* mixer = 443 media::AudioRendererMixer* mixer =
444 GetMixer(kRenderFrameId, params, kNonexistentDeviceId, kSecurityOrigin, 444 GetMixer(kRenderFrameId, params, kNonexistentDeviceId, kSecurityOrigin,
445 &device_status); 445 &device_status);
446 EXPECT_FALSE(mixer); 446 EXPECT_FALSE(mixer);
447 EXPECT_EQ(media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, device_status); 447 EXPECT_EQ(media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, device_status);
448 EXPECT_EQ(0, mixer_count()); 448 EXPECT_EQ(0, mixer_count());
449 } 449 }
450 450
451 } // namespace content 451 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_renderer_mixer_manager.cc ('k') | content/renderer/pepper/pepper_platform_audio_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698