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