Chromium Code Reviews| Index: components/copresence/handlers/audio/audio_directive_handler_unittest.cc |
| diff --git a/components/copresence/handlers/audio/audio_directive_handler_unittest.cc b/components/copresence/handlers/audio/audio_directive_handler_unittest.cc |
| index 0400662149ec58ca854406e17abf6fe5ac2caadc..d4ebbfd2d29972a4cb52771d2c0f6bd66ca81d1a 100644 |
| --- a/components/copresence/handlers/audio/audio_directive_handler_unittest.cc |
| +++ b/components/copresence/handlers/audio/audio_directive_handler_unittest.cc |
| @@ -16,26 +16,14 @@ |
| namespace copresence { |
| -namespace { |
| - |
| -// Callback stubs to pass into the directive handler. |
| -void DecodeSamples(AudioType, const std::string&) { |
| -} |
| -void EncodeToken(const std::string&, |
| - AudioType, |
| - const AudioManager::SamplesCallback&) { |
| -} |
| - |
| -} // namespace |
| - |
| class AudioManagerStub final : public AudioManager { |
| public: |
| AudioManagerStub() {} |
| ~AudioManagerStub() override {} |
| // AudioManager overrides: |
| - void Initialize(const DecodeSamplesCallback& decode_cb, |
| - const EncodeTokenCallback& encode_cb) override {} |
| + void Initialize(WhispernetClient* whispernet_client, |
| + const TokensCallback& tokens_cb) override {} |
| void StartPlaying(AudioType type) override { playing_[type] = true; } |
| void StopPlaying(AudioType type) override { playing_[type] = false; } |
| void StartRecording(AudioType type) override { recording_[type] = true; } |
| @@ -44,6 +32,7 @@ class AudioManagerStub final : public AudioManager { |
| const std::string GetToken(AudioType type) override { return std::string(); } |
| bool IsRecording(AudioType type) override { return recording_[type]; } |
| bool IsPlaying(AudioType type) override { return playing_[type]; } |
| + bool IsPlayingTokenHeard(AudioType type) override { return false; } |
| private: |
| // Indexed using enum AudioType. |
| @@ -59,13 +48,13 @@ class AudioDirectiveHandlerTest : public testing::Test { |
| manager_ptr_ = new AudioManagerStub; |
| timer_ptr_ = new base::MockTimer(false, false); |
| clock_ptr_ = new base::SimpleTestTickClock; |
| + // whispernet_client_.reset(new StubWhispernetClient); |
|
xiyuan
2014/11/06 21:27:50
nit: Remove?
rkc
2014/11/06 21:45:05
Done.
|
| directive_handler_.reset(new AudioDirectiveHandlerImpl( |
| make_scoped_ptr<AudioManager>(manager_ptr_), |
| make_scoped_ptr<base::Timer>(timer_ptr_), |
| make_scoped_refptr(new TickClockRefCounted(clock_ptr_)))); |
| - directive_handler_->Initialize(base::Bind(&DecodeSamples), |
| - base::Bind(&EncodeToken)); |
| + directive_handler_->Initialize(nullptr, TokensCallback()); |
| } |
| ~AudioDirectiveHandlerTest() override {} |