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.
5 #include "components/audio_modem/test/stub_whispernet_client.h"
7 namespace audio_modem
{
9 StubWhispernetClient::StubWhispernetClient(
10 scoped_refptr
<media::AudioBusRefCounted
> samples
,
11 const std::vector
<AudioToken
>& tokens
)
16 StubWhispernetClient::~StubWhispernetClient() {}
18 void StubWhispernetClient::Initialize(const SuccessCallback
& init_callback
) {}
20 void StubWhispernetClient::EncodeToken(const std::string
& token
,
22 const TokenParameters token_params
[2]) {
23 if (!samples_cb_
.is_null())
24 samples_cb_
.Run(type
, token
, samples_
);
27 void StubWhispernetClient::DecodeSamples(
29 const std::string
& samples
,
30 const TokenParameters token_params
[2]) {
31 if (!tokens_cb_
.is_null())
32 tokens_cb_
.Run(tokens_
);
35 void StubWhispernetClient::RegisterTokensCallback(
36 const TokensCallback
& tokens_cb
) {
37 tokens_cb_
= tokens_cb
;
40 void StubWhispernetClient::RegisterSamplesCallback(
41 const SamplesCallback
& samples_cb
) {
42 samples_cb_
= samples_cb
;
45 TokensCallback
StubWhispernetClient::GetTokensCallback() {
49 SamplesCallback
StubWhispernetClient::GetSamplesCallback() {
53 SuccessCallback
StubWhispernetClient::GetInitializedCallback() {
54 return SuccessCallback();
57 } // namespace audio_modem