| 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 "content/browser/bluetooth/bluetooth_blacklist.h" | 5 #include "content/browser/bluetooth/bluetooth_blacklist.h" |
| 6 | 6 |
| 7 #include "content/common/bluetooth/bluetooth_scan_filter.h" | 7 #include "content/common/bluetooth/bluetooth_scan_filter.h" |
| 8 #include "device/bluetooth/bluetooth_uuid.h" | 8 #include "device/bluetooth/bluetooth_uuid.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 std::vector<BluetoothUUID> expected_empty; | 344 std::vector<BluetoothUUID> expected_empty; |
| 345 | 345 |
| 346 list_.RemoveExcludedUuids(&all_matching_of_many); | 346 list_.RemoveExcludedUuids(&all_matching_of_many); |
| 347 EXPECT_EQ(expected_empty, all_matching_of_many); | 347 EXPECT_EQ(expected_empty, all_matching_of_many); |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 | 350 |
| 351 TEST_F(BluetoothBlacklistTest, VerifyDefaultBlacklistSize) { | 351 TEST_F(BluetoothBlacklistTest, VerifyDefaultBlacklistSize) { |
| 352 // When adding items to the blacklist the new values should be added in the | 352 // When adding items to the blacklist the new values should be added in the |
| 353 // tests below for each exclusion type. | 353 // tests below for each exclusion type. |
| 354 EXPECT_EQ(9u, list_.size()); | 354 EXPECT_EQ(11u, list_.size()); |
| 355 } | 355 } |
| 356 | 356 |
| 357 TEST_F(BluetoothBlacklistTest, VerifyDefaultExcludeList) { | 357 TEST_F(BluetoothBlacklistTest, VerifyDefaultExcludeList) { |
| 358 EXPECT_FALSE(list_.IsExcluded(BluetoothUUID("1800"))); | 358 EXPECT_FALSE(list_.IsExcluded(BluetoothUUID("1800"))); |
| 359 EXPECT_FALSE(list_.IsExcluded(BluetoothUUID("1801"))); | 359 EXPECT_FALSE(list_.IsExcluded(BluetoothUUID("1801"))); |
| 360 EXPECT_TRUE(list_.IsExcluded(BluetoothUUID("1812"))); | 360 EXPECT_TRUE(list_.IsExcluded(BluetoothUUID("1812"))); |
| 361 EXPECT_TRUE( |
| 362 list_.IsExcluded(BluetoothUUID("00001530-1212-efde-1523-785feabcd123"))); |
| 363 EXPECT_TRUE( |
| 364 list_.IsExcluded(BluetoothUUID("f000ffc0-0451-4000-b000-000000000000"))); |
| 361 EXPECT_TRUE(list_.IsExcluded(BluetoothUUID("2a03"))); | 365 EXPECT_TRUE(list_.IsExcluded(BluetoothUUID("2a03"))); |
| 362 EXPECT_TRUE(list_.IsExcluded(BluetoothUUID("2a25"))); | 366 EXPECT_TRUE(list_.IsExcluded(BluetoothUUID("2a25"))); |
| 363 EXPECT_TRUE( | 367 EXPECT_TRUE( |
| 364 list_.IsExcluded(BluetoothUUID("bad2ddcf-60db-45cd-bef9-fd72b153cf7c"))); | 368 list_.IsExcluded(BluetoothUUID("bad2ddcf-60db-45cd-bef9-fd72b153cf7c"))); |
| 365 } | 369 } |
| 366 | 370 |
| 367 TEST_F(BluetoothBlacklistTest, VerifyDefaultExcludeReadList) { | 371 TEST_F(BluetoothBlacklistTest, VerifyDefaultExcludeReadList) { |
| 368 EXPECT_FALSE(list_.IsExcludedFromReads(BluetoothUUID("1800"))); | 372 EXPECT_FALSE(list_.IsExcludedFromReads(BluetoothUUID("1800"))); |
| 369 EXPECT_FALSE(list_.IsExcludedFromReads(BluetoothUUID("1801"))); | 373 EXPECT_FALSE(list_.IsExcludedFromReads(BluetoothUUID("1801"))); |
| 370 EXPECT_TRUE(list_.IsExcludedFromReads(BluetoothUUID("1812"))); | 374 EXPECT_TRUE(list_.IsExcludedFromReads(BluetoothUUID("1812"))); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 385 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2a02"))); | 389 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2a02"))); |
| 386 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2a03"))); | 390 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2a03"))); |
| 387 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2a25"))); | 391 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2a25"))); |
| 388 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2902"))); | 392 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2902"))); |
| 389 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2903"))); | 393 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2903"))); |
| 390 EXPECT_TRUE(list_.IsExcludedFromWrites( | 394 EXPECT_TRUE(list_.IsExcludedFromWrites( |
| 391 BluetoothUUID("bad2ddcf-60db-45cd-bef9-fd72b153cf7c"))); | 395 BluetoothUUID("bad2ddcf-60db-45cd-bef9-fd72b153cf7c"))); |
| 392 } | 396 } |
| 393 | 397 |
| 394 } // namespace content | 398 } // namespace content |
| OLD | NEW |