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 "components/proximity_auth/ble/bluetooth_low_energy_weave_packet_genera
tor.h" | 5 #include "components/cryptauth/ble/bluetooth_low_energy_weave_packet_generator.h
" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace proximity_auth { | 15 namespace cryptauth { |
16 namespace weave { | 16 namespace weave { |
17 | 17 |
18 class ProximityAuthBluetoothLowEnergyWeavePacketGeneratorTest | 18 class ProximityAuthBluetoothLowEnergyWeavePacketGeneratorTest |
19 : public testing::Test { | 19 : public testing::Test { |
20 protected: | 20 protected: |
21 ProximityAuthBluetoothLowEnergyWeavePacketGeneratorTest() {} | 21 ProximityAuthBluetoothLowEnergyWeavePacketGeneratorTest() {} |
22 | 22 |
23 void TestConnectionCloseWithReason(ReasonForClose reason_for_close, | 23 void TestConnectionCloseWithReason(ReasonForClose reason_for_close, |
24 uint8_t expected_reason_for_close) { | 24 uint8_t expected_reason_for_close) { |
25 std::unique_ptr<BluetoothLowEnergyWeavePacketGenerator> generator = | 25 std::unique_ptr<BluetoothLowEnergyWeavePacketGenerator> generator = |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 for (uint8_t i = 0; i < kNumPackets; ++i) { | 255 for (uint8_t i = 0; i < kNumPackets; ++i) { |
256 uint8_t header = packets[i][0]; | 256 uint8_t header = packets[i][0]; |
257 EXPECT_EQ(i % kMaxPacketCounter, GetCounterFromHeader(header)); | 257 EXPECT_EQ(i % kMaxPacketCounter, GetCounterFromHeader(header)); |
258 EXPECT_EQ(kDataType, GetPacketType(header)); | 258 EXPECT_EQ(kDataType, GetPacketType(header)); |
259 } | 259 } |
260 } | 260 } |
261 | 261 |
262 } // namespace weave | 262 } // namespace weave |
263 | 263 |
264 } // namespace proximity_auth | 264 } // namespace cryptauth |
OLD | NEW |