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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
| 7 #include <memory> |
7 #include <string> | 8 #include <string> |
8 | 9 |
9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
11 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "media/audio/audio_manager.h" | 14 #include "media/audio/audio_manager.h" |
14 #include "media/audio/audio_manager_base.h" | 15 #include "media/audio/audio_manager_base.h" |
15 #include "media/audio/audio_output_dispatcher_impl.h" | 16 #include "media/audio/audio_output_dispatcher_impl.h" |
16 #include "media/audio/audio_output_proxy.h" | 17 #include "media/audio/audio_output_proxy.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 77 |
77 MOCK_METHOD0(Open, bool()); | 78 MOCK_METHOD0(Open, bool()); |
78 MOCK_METHOD1(SetVolume, void(double volume)); | 79 MOCK_METHOD1(SetVolume, void(double volume)); |
79 MOCK_METHOD1(GetVolume, void(double* volume)); | 80 MOCK_METHOD1(GetVolume, void(double* volume)); |
80 MOCK_METHOD0(Close, void()); | 81 MOCK_METHOD0(Close, void()); |
81 | 82 |
82 private: | 83 private: |
83 bool start_called_; | 84 bool start_called_; |
84 bool stop_called_; | 85 bool stop_called_; |
85 AudioParameters params_; | 86 AudioParameters params_; |
86 scoped_ptr<AudioOutputStream> fake_output_stream_; | 87 std::unique_ptr<AudioOutputStream> fake_output_stream_; |
87 }; | 88 }; |
88 | 89 |
89 class MockAudioManager : public AudioManagerBase { | 90 class MockAudioManager : public AudioManagerBase { |
90 public: | 91 public: |
91 MockAudioManager() | 92 MockAudioManager() |
92 : AudioManagerBase(base::ThreadTaskRunnerHandle::Get(), | 93 : AudioManagerBase(base::ThreadTaskRunnerHandle::Get(), |
93 base::ThreadTaskRunnerHandle::Get(), | 94 base::ThreadTaskRunnerHandle::Get(), |
94 &fake_audio_log_factory_) {} | 95 &fake_audio_log_factory_) {} |
95 ~MockAudioManager() override { Shutdown(); } | 96 ~MockAudioManager() override { Shutdown(); } |
96 | 97 |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 _)).WillOnce(Return(&real_stream)); | 725 _)).WillOnce(Return(&real_stream)); |
725 | 726 |
726 // Stream1 should be able to successfully open and start. | 727 // Stream1 should be able to successfully open and start. |
727 EXPECT_CALL(real_stream, Open()).WillOnce(Return(true)); | 728 EXPECT_CALL(real_stream, Open()).WillOnce(Return(true)); |
728 proxy = new AudioOutputProxy(resampler_.get()); | 729 proxy = new AudioOutputProxy(resampler_.get()); |
729 EXPECT_TRUE(proxy->Open()); | 730 EXPECT_TRUE(proxy->Open()); |
730 CloseAndWaitForCloseTimer(proxy, &real_stream); | 731 CloseAndWaitForCloseTimer(proxy, &real_stream); |
731 } | 732 } |
732 | 733 |
733 } // namespace media | 734 } // namespace media |
OLD | NEW |