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 #include "chromeos/components/tether/ble_scanner.h" | 5 #include "chromeos/components/tether/ble_scanner.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chromeos/components/tether/ble_constants.h" | 8 #include "chromeos/components/tether/ble_constants.h" |
9 #include "chromeos/components/tether/mock_local_device_data_provider.h" | 9 #include "chromeos/components/tether/mock_local_device_data_provider.h" |
10 #include "components/cryptauth/mock_foreground_eid_generator.h" | 10 #include "components/cryptauth/mock_foreground_eid_generator.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 const std::string fake_beacon_seed1_data = "fakeBeaconSeed1Data"; | 94 const std::string fake_beacon_seed1_data = "fakeBeaconSeed1Data"; |
95 const int64_t fake_beacon_seed1_start_ms = current_eid_start_ms; | 95 const int64_t fake_beacon_seed1_start_ms = current_eid_start_ms; |
96 const int64_t fake_beacon_seed1_end_ms = current_eid_end_ms; | 96 const int64_t fake_beacon_seed1_end_ms = current_eid_end_ms; |
97 | 97 |
98 const std::string fake_beacon_seed2_data = "fakeBeaconSeed2Data"; | 98 const std::string fake_beacon_seed2_data = "fakeBeaconSeed2Data"; |
99 const int64_t fake_beacon_seed2_start_ms = adjacent_eid_start_ms; | 99 const int64_t fake_beacon_seed2_start_ms = adjacent_eid_start_ms; |
100 const int64_t fake_beacon_seed2_end_ms = adjacent_eid_end_ms; | 100 const int64_t fake_beacon_seed2_end_ms = adjacent_eid_end_ms; |
101 | 101 |
102 std::unique_ptr<cryptauth::ForegroundEidGenerator::EidData> | 102 std::unique_ptr<cryptauth::ForegroundEidGenerator::EidData> |
103 CreateFakeBackgroundScanFilter() { | 103 CreateFakeBackgroundScanFilter() { |
104 cryptauth::ForegroundEidGenerator::DataWithTimestamp current( | 104 cryptauth::DataWithTimestamp current(current_eid_data, current_eid_start_ms, |
105 current_eid_data, current_eid_start_ms, current_eid_end_ms); | 105 current_eid_end_ms); |
106 | 106 |
107 std::unique_ptr<cryptauth::ForegroundEidGenerator::DataWithTimestamp> | 107 std::unique_ptr<cryptauth::DataWithTimestamp> adjacent = |
108 adjacent = base::MakeUnique< | 108 base::MakeUnique<cryptauth::DataWithTimestamp>( |
109 cryptauth::ForegroundEidGenerator::DataWithTimestamp>( | |
110 adjacent_eid_data, adjacent_eid_start_ms, adjacent_eid_end_ms); | 109 adjacent_eid_data, adjacent_eid_start_ms, adjacent_eid_end_ms); |
111 | 110 |
112 return base::MakeUnique<cryptauth::ForegroundEidGenerator::EidData>( | 111 return base::MakeUnique<cryptauth::ForegroundEidGenerator::EidData>( |
113 current, std::move(adjacent)); | 112 current, std::move(adjacent)); |
114 } | 113 } |
115 | 114 |
116 std::vector<cryptauth::BeaconSeed> CreateFakeBeaconSeeds() { | 115 std::vector<cryptauth::BeaconSeed> CreateFakeBeaconSeeds() { |
117 cryptauth::BeaconSeed seed1; | 116 cryptauth::BeaconSeed seed1; |
118 seed1.set_data(fake_beacon_seed1_data); | 117 seed1.set_data(fake_beacon_seed1_data); |
119 seed1.set_start_time_millis(fake_beacon_seed1_start_ms); | 118 seed1.set_start_time_millis(fake_beacon_seed1_start_ms); |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 // Unregister device. | 556 // Unregister device. |
558 EXPECT_TRUE(ble_scanner_->IsDeviceRegistered(test_devices_[0].GetDeviceId())); | 557 EXPECT_TRUE(ble_scanner_->IsDeviceRegistered(test_devices_[0].GetDeviceId())); |
559 EXPECT_TRUE(ble_scanner_->UnregisterScanFilterForDevice(test_devices_[0])); | 558 EXPECT_TRUE(ble_scanner_->UnregisterScanFilterForDevice(test_devices_[0])); |
560 EXPECT_FALSE( | 559 EXPECT_FALSE( |
561 ble_scanner_->IsDeviceRegistered(test_devices_[0].GetDeviceId())); | 560 ble_scanner_->IsDeviceRegistered(test_devices_[0].GetDeviceId())); |
562 } | 561 } |
563 | 562 |
564 } // namespace tether | 563 } // namespace tether |
565 | 564 |
566 } // namespace chromeos | 565 } // namespace chromeos |
OLD | NEW |