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

Side by Side Diff: components/audio_modem/test/stub_whispernet_client.h

Issue 2131993002: Delete the audio modem and copresence private APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eol
Patch Set: Sync again Created 4 years, 5 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_AUDIO_MODEM_TEST_STUB_WHISPERNET_CLIENT_H_
6 #define COMPONENTS_AUDIO_MODEM_TEST_STUB_WHISPERNET_CLIENT_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/callback.h"
12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h"
14 #include "components/audio_modem/public/whispernet_client.h"
15 #include "media/base/audio_bus.h"
16
17 namespace audio_modem {
18
19 // A simple WhispernetClient for testing.
20 class StubWhispernetClient final : public WhispernetClient {
21 public:
22 // Constructor. |samples| and |tokens|, if specified,
23 // will be returned for any encoding and decoding requests.
24 StubWhispernetClient(
25 scoped_refptr<media::AudioBusRefCounted> samples =
26 scoped_refptr<media::AudioBusRefCounted>(),
27 const std::vector<AudioToken>& tokens = std::vector<AudioToken>());
28
29 ~StubWhispernetClient() override;
30
31 void Initialize(const SuccessCallback& init_callback) override;
32
33 void EncodeToken(const std::string& token,
34 AudioType type,
35 const TokenParameters token_params[2]) override;
36 void DecodeSamples(AudioType type,
37 const std::string& samples,
38 const TokenParameters token_params[2]) override;
39
40 void RegisterTokensCallback(const TokensCallback& tokens_cb) override;
41 void RegisterSamplesCallback(const SamplesCallback& samples_cb) override;
42
43 TokensCallback GetTokensCallback() override;
44 SamplesCallback GetSamplesCallback() override;
45 SuccessCallback GetInitializedCallback() override;
46
47 private:
48 TokensCallback tokens_cb_;
49 SamplesCallback samples_cb_;
50 scoped_refptr<media::AudioBusRefCounted> samples_;
51 std::vector<AudioToken> tokens_;
52
53 DISALLOW_COPY_AND_ASSIGN(StubWhispernetClient);
54 };
55
56 } // namespace audio_modem
57
58 #endif // COMPONENTS_AUDIO_MODEM_TEST_STUB_WHISPERNET_CLIENT_H_
OLDNEW
« no previous file with comments | « components/audio_modem/test/stub_modem.cc ('k') | components/audio_modem/test/stub_whispernet_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698