OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_CRYPTAUTH_BLE_MOCK_FOREGROUND_EID_GENERATOR_H_ | 5 #ifndef COMPONENTS_CRYPTAUTH_BLE_MOCK_FOREGROUND_EID_GENERATOR_H_ |
6 #define COMPONENTS_CRYPTAUTH_BLE_MOCK_FOREGROUND_EID_GENERATOR_H_ | 6 #define COMPONENTS_CRYPTAUTH_BLE_MOCK_FOREGROUND_EID_GENERATOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 MockForegroundEidGenerator(); | 24 MockForegroundEidGenerator(); |
25 ~MockForegroundEidGenerator() override; | 25 ~MockForegroundEidGenerator() override; |
26 | 26 |
27 // Setters for the return values of the overridden functions below. | 27 // Setters for the return values of the overridden functions below. |
28 void set_background_scan_filter( | 28 void set_background_scan_filter( |
29 std::unique_ptr<EidData> background_scan_filter) { | 29 std::unique_ptr<EidData> background_scan_filter) { |
30 background_scan_filter_ = std::move(background_scan_filter); | 30 background_scan_filter_ = std::move(background_scan_filter); |
31 } | 31 } |
32 | 32 |
33 void set_advertisement(std::unique_ptr<DataWithTimestamp> advertisement) { | 33 void set_advertisement(std::unique_ptr<EidDataWithTimestamp> advertisement) { |
34 advertisement_ = std::move(advertisement); | 34 advertisement_ = std::move(advertisement); |
35 } | 35 } |
36 | 36 |
37 void set_possible_advertisements( | 37 void set_possible_advertisements( |
38 std::unique_ptr<std::vector<std::string>> possible_advertisements) { | 38 std::unique_ptr<std::vector<std::string>> possible_advertisements) { |
39 possible_advertisements_ = std::move(possible_advertisements); | 39 possible_advertisements_ = std::move(possible_advertisements); |
40 } | 40 } |
41 | 41 |
42 void set_identified_device(RemoteDevice* identified_device) { | 42 void set_identified_device(RemoteDevice* identified_device) { |
43 identified_device_ = identified_device; | 43 identified_device_ = identified_device; |
44 } | 44 } |
45 | 45 |
46 // ForegroundEidGenerator: | 46 // ForegroundEidGenerator: |
47 std::unique_ptr<EidData> GenerateBackgroundScanFilter( | 47 std::unique_ptr<EidData> GenerateBackgroundScanFilter( |
48 const std::vector<BeaconSeed>& scanning_device_beacon_seeds) | 48 const std::vector<BeaconSeed>& scanning_device_beacon_seeds) |
49 const override; | 49 const override; |
50 std::unique_ptr<DataWithTimestamp> GenerateAdvertisement( | 50 std::unique_ptr<EidDataWithTimestamp> GenerateAdvertisement( |
51 const std::string& advertising_device_public_key, | 51 const std::string& advertising_device_public_key, |
52 const std::vector<BeaconSeed>& scanning_device_beacon_seeds) | 52 const std::vector<BeaconSeed>& scanning_device_beacon_seeds) |
53 const override; | 53 const override; |
54 std::vector<std::string> GeneratePossibleAdvertisements( | 54 std::vector<std::string> GeneratePossibleAdvertisements( |
55 const std::string& advertising_device_public_key, | 55 const std::string& advertising_device_public_key, |
56 const std::vector<BeaconSeed>& scanning_device_beacon_seeds) | 56 const std::vector<BeaconSeed>& scanning_device_beacon_seeds) |
57 const override; | 57 const override; |
58 RemoteDevice const* IdentifyRemoteDeviceByAdvertisement( | 58 RemoteDevice const* IdentifyRemoteDeviceByAdvertisement( |
59 const std::string& advertisement_service_data, | 59 const std::string& advertisement_service_data, |
60 const std::vector<RemoteDevice>& device_list, | 60 const std::vector<RemoteDevice>& device_list, |
61 const std::vector<BeaconSeed>& scanning_device_beacon_seeds) | 61 const std::vector<BeaconSeed>& scanning_device_beacon_seeds) |
62 const override; | 62 const override; |
63 | 63 |
64 int num_identify_calls() { return num_identify_calls_; } | 64 int num_identify_calls() { return num_identify_calls_; } |
65 | 65 |
66 private: | 66 private: |
67 std::unique_ptr<EidData> background_scan_filter_; | 67 std::unique_ptr<EidData> background_scan_filter_; |
68 std::unique_ptr<DataWithTimestamp> advertisement_; | 68 std::unique_ptr<EidDataWithTimestamp> advertisement_; |
69 std::unique_ptr<std::vector<std::string>> possible_advertisements_; | 69 std::unique_ptr<std::vector<std::string>> possible_advertisements_; |
70 const RemoteDevice* identified_device_; | 70 const RemoteDevice* identified_device_; |
71 | 71 |
72 int num_identify_calls_; | 72 int num_identify_calls_; |
73 }; | 73 }; |
74 | 74 |
75 } // namespace cryptauth | 75 } // namespace cryptauth |
76 | 76 |
77 #endif // COMPONENTS_CRYPTAUTH_BLE_MOCK_FOREGROUND_EID_GENERATOR_H_ | 77 #endif // COMPONENTS_CRYPTAUTH_BLE_MOCK_FOREGROUND_EID_GENERATOR_H_ |
OLD | NEW |