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

Side by Side Diff: components/cryptauth/fake_secure_channel.h

Issue 2697763002: [CrOS Tether]: Create BleConnectionManager, which manages secure connections between the current de… (Closed)
Patch Set: Add missing DEP. Created 3 years, 10 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 2017 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_CRYPTAUTH_FAKE_SECURE_CHANNEL_H_
6 #define COMPONENTS_CRYPTAUTH_FAKE_SECURE_CHANNEL_H_
7
8 #include "base/macros.h"
9 #include "components/cryptauth/secure_channel.h"
10
11 namespace cryptauth {
12
13 // A fake implementation of SecureChannel to use in tests.
14 class FakeSecureChannel : public SecureChannel {
15 public:
16 FakeSecureChannel(std::unique_ptr<Connection> connection,
17 std::unique_ptr<Delegate> delegate);
18 ~FakeSecureChannel() override;
19
20 struct SentMessage {
21 SentMessage(const std::string& feature, const std::string& payload);
22
23 std::string feature;
24 std::string payload;
25 };
26
27 void ChangeStatus(const Status& new_status);
28 void ReceiveMessage(const std::string& feature, const std::string& payload);
29
30 std::vector<Observer*> observers() { return observers_; }
31
32 std::vector<SentMessage> sent_messages() { return sent_messages_; }
33
34 // SecureChannel:
35 void Initialize() override;
36 void SendMessage(const std::string& feature,
37 const std::string& payload) override;
38 void Disconnect() override;
39 void AddObserver(Observer* observer) override;
40 void RemoveObserver(Observer* observer) override;
41
42 private:
43 std::vector<Observer*> observers_;
44 std::vector<SentMessage> sent_messages_;
45
46 DISALLOW_COPY_AND_ASSIGN(FakeSecureChannel);
47 };
48
49 } // namespace cryptauth
50
51 #endif // COMPONENTS_CRYPTAUTH_FAKE_SECURE_CHANNEL_H_
OLDNEW
« no previous file with comments | « components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc ('k') | components/cryptauth/fake_secure_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698