| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_COPRESENCE_TEST_STUB_WHISPERNET_CLIENT_H_ | 5 #ifndef COMPONENTS_COPRESENCE_TEST_STUB_WHISPERNET_CLIENT_H_ | 
| 6 #define COMPONENTS_COPRESENCE_TEST_STUB_WHISPERNET_CLIENT_H_ | 6 #define COMPONENTS_COPRESENCE_TEST_STUB_WHISPERNET_CLIENT_H_ | 
| 7 | 7 | 
|  | 8 #include "base/callback.h" | 
|  | 9 #include "base/macros.h" | 
|  | 10 | 
| 8 #include "components/copresence/public/whispernet_client.h" | 11 #include "components/copresence/public/whispernet_client.h" | 
| 9 | 12 | 
| 10 namespace copresence { | 13 namespace copresence { | 
| 11 | 14 | 
| 12 // An empty WhispernetClient for testing. | 15 // An empty WhispernetClient for testing. | 
| 13 class StubWhispernetClient final : public WhispernetClient { | 16 class StubWhispernetClient final : public WhispernetClient { | 
| 14  public: | 17  public: | 
| 15   StubWhispernetClient() {} | 18   StubWhispernetClient(); | 
|  | 19   ~StubWhispernetClient() override; | 
| 16 | 20 | 
| 17   void Initialize(const SuccessCallback& /* init_callback */) override {} | 21   void Initialize(const SuccessCallback& /* init_cb */) override {} | 
| 18   void Shutdown() override {} | 22   void Shutdown() override {} | 
| 19   void EncodeToken(const std::string& /* token */, AudioType /* type */) | 23   void EncodeToken(const std::string& token, AudioType type) override; | 
| 20       override {} | 24   void DecodeSamples(AudioType type, const std::string& samples) override; | 
| 21   void DecodeSamples(AudioType /* type */, const std::string& /* samples */) |  | 
| 22       override {} |  | 
| 23   void DetectBroadcast() override {} | 25   void DetectBroadcast() override {} | 
| 24   void RegisterTokensCallback( | 26   void RegisterTokensCallback(const TokensCallback& tokens_cb) override; | 
| 25       const TokensCallback& /* tokens_callback */) override {} | 27   void RegisterSamplesCallback(const SamplesCallback& samples_cb) override; | 
| 26   void RegisterSamplesCallback( |  | 
| 27       const SamplesCallback& /* samples_callback */) override {} |  | 
| 28   void RegisterDetectBroadcastCallback( | 28   void RegisterDetectBroadcastCallback( | 
| 29       const SuccessCallback& /* db_callback */) override {} | 29       const SuccessCallback& /* db_cb */) override {} | 
| 30   TokensCallback GetTokensCallback() override; | 30   TokensCallback GetTokensCallback() override; | 
| 31   SamplesCallback GetSamplesCallback() override; | 31   SamplesCallback GetSamplesCallback() override; | 
| 32   SuccessCallback GetDetectBroadcastCallback() override; | 32   SuccessCallback GetDetectBroadcastCallback() override; | 
| 33   SuccessCallback GetInitializedCallback() override; | 33   SuccessCallback GetInitializedCallback() override; | 
|  | 34 | 
|  | 35  private: | 
|  | 36   TokensCallback tokens_cb_; | 
|  | 37   SamplesCallback samples_cb_; | 
|  | 38   std::vector<AudioToken> tokens_; | 
|  | 39   scoped_refptr<media::AudioBusRefCounted> samples_; | 
|  | 40 | 
|  | 41   DISALLOW_COPY_AND_ASSIGN(StubWhispernetClient); | 
| 34 }; | 42 }; | 
| 35 | 43 | 
| 36 }  // namespace copresence | 44 }  // namespace copresence | 
| 37 | 45 | 
| 38 #endif  // COMPONENTS_COPRESENCE_TEST_STUB_WHISPERNET_CLIENT_H_ | 46 #endif  // COMPONENTS_COPRESENCE_TEST_STUB_WHISPERNET_CLIENT_H_ | 
| OLD | NEW | 
|---|