Use multiline attribute to check for IA2_STATE_MULTILINE.
[chromium-blink-merge.git] / components / audio_modem / test / stub_modem.h
blobe76f5e358d65548d99f19caa427128e5a19d0421
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 #ifndef COMPONENTS_AUDIO_MODEM_TEST_STUB_MODEM_H_
6 #define COMPONENTS_AUDIO_MODEM_TEST_STUB_MODEM_H_
8 #include <string>
9 #include <vector>
11 #include "base/callback.h"
12 #include "components/audio_modem/public/modem.h"
14 namespace audio_modem {
16 class StubModem final : public Modem {
17 public:
18 StubModem();
19 ~StubModem() override;
21 // AudioManager overrides:
22 void Initialize(WhispernetClient* whispernet_client,
23 const TokensCallback& tokens_cb) override;
24 void StartPlaying(AudioType type) override;
25 void StopPlaying(AudioType type) override;
26 void StartRecording(AudioType type) override;
27 void StopRecording(AudioType type) override;
28 void SetToken(AudioType type, const std::string& url_unsafe_token) override {}
29 const std::string GetToken(AudioType type) const override;
30 bool IsPlayingTokenHeard(AudioType type) const override;
31 void SetTokenParams(AudioType type, const TokenParameters& params) override {}
33 bool IsRecording(AudioType type) const;
34 bool IsPlaying(AudioType type) const;
36 // Encodes tokens as base64 and then delivers them.
37 void DeliverTokens(const std::vector<AudioToken>& tokens);
39 private:
40 // Indexed using enum AudioType.
41 bool playing_[2];
42 bool recording_[2];
44 TokensCallback tokens_callback_;
46 DISALLOW_COPY_AND_ASSIGN(StubModem);
49 } // namespace audio_modem
51 #endif // COMPONENTS_AUDIO_MODEM_TEST_STUB_MODEM_H_