Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / components / audio_modem / test / stub_whispernet_client.cc
blobe2763ce9307bfe31c9214fdb553a233fde7e6441
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)
12 : samples_(samples),
13 tokens_(tokens) {
16 StubWhispernetClient::~StubWhispernetClient() {}
18 void StubWhispernetClient::Initialize(const SuccessCallback& init_callback) {}
20 void StubWhispernetClient::EncodeToken(const std::string& token,
21 AudioType type,
22 const TokenParameters token_params[2]) {
23 if (!samples_cb_.is_null())
24 samples_cb_.Run(type, token, samples_);
27 void StubWhispernetClient::DecodeSamples(
28 AudioType type,
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() {
46 return tokens_cb_;
49 SamplesCallback StubWhispernetClient::GetSamplesCallback() {
50 return samples_cb_;
53 SuccessCallback StubWhispernetClient::GetInitializedCallback() {
54 return SuccessCallback();
57 } // namespace audio_modem