| 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_blocklist.h" | 5 #include "content/browser/bluetooth/bluetooth_blocklist.h" |
| 6 | 6 |
| 7 #include "device/bluetooth/bluetooth_uuid.h" | 7 #include "device/bluetooth/bluetooth_uuid.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 using device::BluetoothUUID; | 10 using device::BluetoothUUID; |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 namespace { | |
| 15 | |
| 16 base::Optional<BluetoothUUID> Canonicalize(const std::string& str) { | |
| 17 return base::make_optional(device::BluetoothUUID(str)); | |
| 18 } | |
| 19 | |
| 20 } // namespace | |
| 21 | |
| 22 class BluetoothBlocklistTest : public ::testing::Test { | 14 class BluetoothBlocklistTest : public ::testing::Test { |
| 23 public: | 15 public: |
| 24 BluetoothBlocklistTest() : list_(BluetoothBlocklist::Get()) { | 16 BluetoothBlocklistTest() : list_(BluetoothBlocklist::Get()) { |
| 25 // Because BluetoothBlocklist is used via a singleton instance, the data | 17 // Because BluetoothBlocklist is used via a singleton instance, the data |
| 26 // must be reset for each test. | 18 // must be reset for each test. |
| 27 list_.ResetToDefaultValuesForTest(); | 19 list_.ResetToDefaultValuesForTest(); |
| 28 } | 20 } |
| 29 BluetoothBlocklist& list_; | 21 BluetoothBlocklist& list_; |
| 30 }; | 22 }; |
| 31 | 23 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 list_.Add("\r\n0009:e\n\r"); | 210 list_.Add("\r\n0009:e\n\r"); |
| 219 EXPECT_EQ(++previous_list_size, list_.size()); | 211 EXPECT_EQ(++previous_list_size, list_.size()); |
| 220 EXPECT_TRUE(list_.IsExcluded(BluetoothUUID("0009"))); | 212 EXPECT_TRUE(list_.IsExcluded(BluetoothUUID("0009"))); |
| 221 } | 213 } |
| 222 | 214 |
| 223 TEST_F(BluetoothBlocklistTest, IsExcluded_BluetoothScanFilter_ReturnsFalse) { | 215 TEST_F(BluetoothBlocklistTest, IsExcluded_BluetoothScanFilter_ReturnsFalse) { |
| 224 list_.Add(BluetoothUUID("eeee"), BluetoothBlocklist::Value::EXCLUDE); | 216 list_.Add(BluetoothUUID("eeee"), BluetoothBlocklist::Value::EXCLUDE); |
| 225 list_.Add(BluetoothUUID("ee01"), BluetoothBlocklist::Value::EXCLUDE_READS); | 217 list_.Add(BluetoothUUID("ee01"), BluetoothBlocklist::Value::EXCLUDE_READS); |
| 226 list_.Add(BluetoothUUID("ee02"), BluetoothBlocklist::Value::EXCLUDE_WRITES); | 218 list_.Add(BluetoothUUID("ee02"), BluetoothBlocklist::Value::EXCLUDE_WRITES); |
| 227 { | 219 { |
| 228 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> empty_filters; | 220 std::vector<blink::mojom::WebBluetoothScanFilterPtr> empty_filters; |
| 229 EXPECT_FALSE(list_.IsExcluded(empty_filters)); | 221 EXPECT_FALSE(list_.IsExcluded(empty_filters)); |
| 230 } | 222 } |
| 231 { | 223 { |
| 232 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> single_empty_filter(1); | 224 std::vector<blink::mojom::WebBluetoothScanFilterPtr> |
| 225 single_filter_with_no_services(1); |
| 226 |
| 227 single_filter_with_no_services[0] = |
| 228 blink::mojom::WebBluetoothScanFilter::New(); |
| 229 |
| 230 EXPECT_FALSE(single_filter_with_no_services[0]->services); |
| 231 EXPECT_FALSE(list_.IsExcluded(single_filter_with_no_services)); |
| 232 } |
| 233 { |
| 234 std::vector<blink::mojom::WebBluetoothScanFilterPtr> single_empty_filter(1); |
| 233 | 235 |
| 234 single_empty_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); | 236 single_empty_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); |
| 235 single_empty_filter[0]->services = | 237 single_empty_filter[0]->services.emplace(); |
| 236 mojo::Array<base::Optional<BluetoothUUID>>(); | |
| 237 | 238 |
| 238 EXPECT_EQ(0u, single_empty_filter[0]->services.size()); | 239 EXPECT_EQ(0u, single_empty_filter[0]->services->size()); |
| 239 EXPECT_FALSE(list_.IsExcluded(single_empty_filter)); | 240 EXPECT_FALSE(list_.IsExcluded(single_empty_filter)); |
| 240 } | 241 } |
| 241 { | 242 { |
| 242 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> | 243 std::vector<blink::mojom::WebBluetoothScanFilterPtr> |
| 243 single_non_matching_filter(1); | 244 single_non_matching_filter(1); |
| 244 | 245 |
| 245 single_non_matching_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); | 246 single_non_matching_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); |
| 246 single_non_matching_filter[0]->services.push_back(Canonicalize("0000")); | 247 single_non_matching_filter[0]->services.emplace(); |
| 248 single_non_matching_filter[0]->services->push_back(BluetoothUUID("0000")); |
| 247 | 249 |
| 248 EXPECT_FALSE(list_.IsExcluded(single_non_matching_filter)); | 250 EXPECT_FALSE(list_.IsExcluded(single_non_matching_filter)); |
| 249 } | 251 } |
| 250 { | 252 { |
| 251 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> | 253 std::vector<blink::mojom::WebBluetoothScanFilterPtr> |
| 252 multiple_non_matching_filters(2); | 254 multiple_non_matching_filters(2); |
| 253 | 255 |
| 254 multiple_non_matching_filters[0] = | 256 multiple_non_matching_filters[0] = |
| 255 blink::mojom::WebBluetoothScanFilter::New(); | 257 blink::mojom::WebBluetoothScanFilter::New(); |
| 256 multiple_non_matching_filters[0]->services.push_back(Canonicalize("0000")); | 258 multiple_non_matching_filters[0]->services.emplace(); |
| 257 multiple_non_matching_filters[0]->services.push_back(Canonicalize("ee01")); | 259 multiple_non_matching_filters[0]->services->push_back( |
| 260 BluetoothUUID("0000")); |
| 261 multiple_non_matching_filters[0]->services->push_back( |
| 262 BluetoothUUID("ee01")); |
| 258 | 263 |
| 259 multiple_non_matching_filters[1] = | 264 multiple_non_matching_filters[1] = |
| 260 blink::mojom::WebBluetoothScanFilter::New(); | 265 blink::mojom::WebBluetoothScanFilter::New(); |
| 261 multiple_non_matching_filters[1]->services.push_back(Canonicalize("ee02")); | 266 multiple_non_matching_filters[1]->services.emplace(); |
| 262 multiple_non_matching_filters[1]->services.push_back(Canonicalize("0003")); | 267 multiple_non_matching_filters[1]->services->push_back( |
| 268 BluetoothUUID("ee02")); |
| 269 multiple_non_matching_filters[1]->services->push_back( |
| 270 BluetoothUUID("0003")); |
| 263 | 271 |
| 264 EXPECT_FALSE(list_.IsExcluded(multiple_non_matching_filters)); | 272 EXPECT_FALSE(list_.IsExcluded(multiple_non_matching_filters)); |
| 265 } | 273 } |
| 266 } | 274 } |
| 267 | 275 |
| 268 TEST_F(BluetoothBlocklistTest, IsExcluded_BluetoothScanFilter_ReturnsTrue) { | 276 TEST_F(BluetoothBlocklistTest, IsExcluded_BluetoothScanFilter_ReturnsTrue) { |
| 269 list_.Add(BluetoothUUID("eeee"), BluetoothBlocklist::Value::EXCLUDE); | 277 list_.Add(BluetoothUUID("eeee"), BluetoothBlocklist::Value::EXCLUDE); |
| 270 { | 278 { |
| 271 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> single_matching_filter( | 279 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> single_matching_filter( |
| 272 1); | 280 1); |
| 273 | 281 |
| 274 single_matching_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); | 282 single_matching_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); |
| 275 single_matching_filter[0]->services.push_back(Canonicalize("eeee")); | 283 single_matching_filter[0]->services.emplace(); |
| 284 single_matching_filter[0]->services->push_back(BluetoothUUID("eeee")); |
| 276 | 285 |
| 277 EXPECT_TRUE(list_.IsExcluded(single_matching_filter)); | 286 EXPECT_TRUE(list_.IsExcluded(single_matching_filter)); |
| 278 } | 287 } |
| 279 { | 288 { |
| 280 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> first_matching_filter( | 289 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> first_matching_filter( |
| 281 2); | 290 2); |
| 282 | 291 |
| 283 first_matching_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); | 292 first_matching_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); |
| 284 first_matching_filter[0]->services.push_back(Canonicalize("eeee")); | 293 first_matching_filter[0]->services.emplace(); |
| 285 first_matching_filter[0]->services.push_back(Canonicalize("0001")); | 294 first_matching_filter[0]->services->push_back(BluetoothUUID("eeee")); |
| 295 first_matching_filter[0]->services->push_back(BluetoothUUID("0001")); |
| 286 | 296 |
| 287 first_matching_filter[1] = blink::mojom::WebBluetoothScanFilter::New(); | 297 first_matching_filter[1] = blink::mojom::WebBluetoothScanFilter::New(); |
| 288 first_matching_filter[1]->services.push_back(Canonicalize("0002")); | 298 first_matching_filter[1]->services.emplace(); |
| 289 first_matching_filter[1]->services.push_back(Canonicalize("0003")); | 299 first_matching_filter[1]->services->push_back(BluetoothUUID("0002")); |
| 300 first_matching_filter[1]->services->push_back(BluetoothUUID("0003")); |
| 290 | 301 |
| 291 EXPECT_TRUE(list_.IsExcluded(first_matching_filter)); | 302 EXPECT_TRUE(list_.IsExcluded(first_matching_filter)); |
| 292 } | 303 } |
| 293 { | 304 { |
| 294 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> last_matching_filter( | 305 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> last_matching_filter( |
| 295 2); | 306 2); |
| 296 | 307 |
| 297 last_matching_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); | 308 last_matching_filter[0] = blink::mojom::WebBluetoothScanFilter::New(); |
| 298 last_matching_filter[0]->services.push_back(Canonicalize("0001")); | 309 last_matching_filter[0]->services.emplace(); |
| 299 last_matching_filter[0]->services.push_back(Canonicalize("0001")); | 310 last_matching_filter[0]->services->push_back(BluetoothUUID("0001")); |
| 311 last_matching_filter[0]->services->push_back(BluetoothUUID("0001")); |
| 300 | 312 |
| 301 last_matching_filter[1] = blink::mojom::WebBluetoothScanFilter::New(); | 313 last_matching_filter[1] = blink::mojom::WebBluetoothScanFilter::New(); |
| 302 last_matching_filter[1]->services.push_back(Canonicalize("0002")); | 314 last_matching_filter[1]->services.emplace(); |
| 303 last_matching_filter[1]->services.push_back(Canonicalize("eeee")); | 315 last_matching_filter[1]->services->push_back(BluetoothUUID("0002")); |
| 316 last_matching_filter[1]->services->push_back(BluetoothUUID("eeee")); |
| 304 | 317 |
| 305 EXPECT_TRUE(list_.IsExcluded(last_matching_filter)); | 318 EXPECT_TRUE(list_.IsExcluded(last_matching_filter)); |
| 306 } | 319 } |
| 307 { | 320 { |
| 308 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> | 321 mojo::Array<blink::mojom::WebBluetoothScanFilterPtr> |
| 309 multiple_matching_filters(2); | 322 multiple_matching_filters(2); |
| 310 | 323 |
| 311 multiple_matching_filters[0] = blink::mojom::WebBluetoothScanFilter::New(); | 324 multiple_matching_filters[0] = blink::mojom::WebBluetoothScanFilter::New(); |
| 312 multiple_matching_filters[0]->services.push_back(Canonicalize("eeee")); | 325 multiple_matching_filters[0]->services.emplace(); |
| 313 multiple_matching_filters[0]->services.push_back(Canonicalize("eeee")); | 326 multiple_matching_filters[0]->services->push_back(BluetoothUUID("eeee")); |
| 327 multiple_matching_filters[0]->services->push_back(BluetoothUUID("eeee")); |
| 314 | 328 |
| 315 multiple_matching_filters[1] = blink::mojom::WebBluetoothScanFilter::New(); | 329 multiple_matching_filters[1] = blink::mojom::WebBluetoothScanFilter::New(); |
| 316 multiple_matching_filters[1]->services.push_back(Canonicalize("eeee")); | 330 multiple_matching_filters[1]->services.emplace(); |
| 317 multiple_matching_filters[1]->services.push_back(Canonicalize("eeee")); | 331 multiple_matching_filters[1]->services->push_back(BluetoothUUID("eeee")); |
| 332 multiple_matching_filters[1]->services->push_back(BluetoothUUID("eeee")); |
| 318 | 333 |
| 319 EXPECT_TRUE(list_.IsExcluded(multiple_matching_filters)); | 334 EXPECT_TRUE(list_.IsExcluded(multiple_matching_filters)); |
| 320 } | 335 } |
| 321 } | 336 } |
| 322 | 337 |
| 323 TEST_F(BluetoothBlocklistTest, RemoveExcludedUUIDs_NonMatching) { | 338 TEST_F(BluetoothBlocklistTest, RemoveExcludedUUIDs_NonMatching) { |
| 324 list_.Add(BluetoothUUID("eeee"), BluetoothBlocklist::Value::EXCLUDE); | 339 list_.Add(BluetoothUUID("eeee"), BluetoothBlocklist::Value::EXCLUDE); |
| 325 list_.Add(BluetoothUUID("ee01"), BluetoothBlocklist::Value::EXCLUDE_READS); | 340 list_.Add(BluetoothUUID("ee01"), BluetoothBlocklist::Value::EXCLUDE_READS); |
| 326 list_.Add(BluetoothUUID("ee02"), BluetoothBlocklist::Value::EXCLUDE_WRITES); | 341 list_.Add(BluetoothUUID("ee02"), BluetoothBlocklist::Value::EXCLUDE_WRITES); |
| 327 | 342 |
| 328 // options.optional_services should be the same before and after | 343 // options.optional_services should be the same before and after |
| 329 // RemoveExcludedUUIDs(). | 344 // RemoveExcludedUUIDs(). |
| 330 { | 345 { |
| 331 // Empty optional_services. | 346 // Empty optional_services. |
| 332 blink::mojom::WebBluetoothRequestDeviceOptions options; | 347 blink::mojom::WebBluetoothRequestDeviceOptions options; |
| 333 options.optional_services = mojo::Array<base::Optional<BluetoothUUID>>(); | |
| 334 | 348 |
| 335 mojo::Array<base::Optional<BluetoothUUID>> expected = | 349 std::vector<BluetoothUUID> expected = options.optional_services; |
| 336 options.optional_services.Clone(); | |
| 337 | 350 |
| 338 list_.RemoveExcludedUUIDs(&options); | 351 list_.RemoveExcludedUUIDs(&options); |
| 339 EXPECT_TRUE(options.optional_services.Equals(expected)); | 352 EXPECT_EQ(expected, options.optional_services); |
| 340 } | 353 } |
| 341 { | 354 { |
| 342 // One non-matching service in optional_services. | 355 // One non-matching service in optional_services. |
| 343 blink::mojom::WebBluetoothRequestDeviceOptions options; | 356 blink::mojom::WebBluetoothRequestDeviceOptions options; |
| 344 options.optional_services.push_back(Canonicalize("0000")); | 357 options.optional_services.push_back(BluetoothUUID("0000")); |
| 345 | 358 |
| 346 mojo::Array<base::Optional<BluetoothUUID>> expected = | 359 std::vector<BluetoothUUID> expected = options.optional_services; |
| 347 options.optional_services.Clone(); | |
| 348 | 360 |
| 349 list_.RemoveExcludedUUIDs(&options); | 361 list_.RemoveExcludedUUIDs(&options); |
| 350 EXPECT_TRUE(options.optional_services.Equals(expected)); | 362 EXPECT_EQ(expected, options.optional_services); |
| 351 } | 363 } |
| 352 { | 364 { |
| 353 // Multiple non-matching services in optional_services. | 365 // Multiple non-matching services in optional_services. |
| 354 blink::mojom::WebBluetoothRequestDeviceOptions options; | 366 blink::mojom::WebBluetoothRequestDeviceOptions options; |
| 355 options.optional_services.push_back(Canonicalize("0000")); | 367 options.optional_services.push_back(BluetoothUUID("0000")); |
| 356 options.optional_services.push_back(Canonicalize("ee01")); | 368 options.optional_services.push_back(BluetoothUUID("ee01")); |
| 357 options.optional_services.push_back(Canonicalize("ee02")); | 369 options.optional_services.push_back(BluetoothUUID("ee02")); |
| 358 options.optional_services.push_back(Canonicalize("0003")); | 370 options.optional_services.push_back(BluetoothUUID("0003")); |
| 359 | 371 |
| 360 mojo::Array<base::Optional<BluetoothUUID>> expected = | 372 std::vector<BluetoothUUID> expected = options.optional_services; |
| 361 options.optional_services.Clone(); | |
| 362 | 373 |
| 363 list_.RemoveExcludedUUIDs(&options); | 374 list_.RemoveExcludedUUIDs(&options); |
| 364 EXPECT_TRUE(options.optional_services.Equals(expected)); | 375 EXPECT_EQ(expected, options.optional_services); |
| 365 } | 376 } |
| 366 } | 377 } |
| 367 | 378 |
| 368 TEST_F(BluetoothBlocklistTest, RemoveExcludedUuids_Matching) { | 379 TEST_F(BluetoothBlocklistTest, RemoveExcludedUuids_Matching) { |
| 369 list_.Add(BluetoothUUID("eeee"), BluetoothBlocklist::Value::EXCLUDE); | 380 list_.Add(BluetoothUUID("eeee"), BluetoothBlocklist::Value::EXCLUDE); |
| 370 list_.Add(BluetoothUUID("eee2"), BluetoothBlocklist::Value::EXCLUDE); | 381 list_.Add(BluetoothUUID("eee2"), BluetoothBlocklist::Value::EXCLUDE); |
| 371 list_.Add(BluetoothUUID("eee3"), BluetoothBlocklist::Value::EXCLUDE); | 382 list_.Add(BluetoothUUID("eee3"), BluetoothBlocklist::Value::EXCLUDE); |
| 372 list_.Add(BluetoothUUID("eee4"), BluetoothBlocklist::Value::EXCLUDE); | 383 list_.Add(BluetoothUUID("eee4"), BluetoothBlocklist::Value::EXCLUDE); |
| 373 { | 384 { |
| 374 // Single matching service in optional_services. | 385 // Single matching service in optional_services. |
| 375 blink::mojom::WebBluetoothRequestDeviceOptions options; | 386 blink::mojom::WebBluetoothRequestDeviceOptions options; |
| 376 options.optional_services.push_back(Canonicalize("eeee")); | 387 options.optional_services.push_back(BluetoothUUID("eeee")); |
| 377 | 388 |
| 378 mojo::Array<base::Optional<BluetoothUUID>> expected; | 389 std::vector<BluetoothUUID> expected; |
| 379 | 390 |
| 380 list_.RemoveExcludedUUIDs(&options); | 391 list_.RemoveExcludedUUIDs(&options); |
| 381 | 392 |
| 382 EXPECT_TRUE(options.optional_services.Equals(expected)); | 393 EXPECT_EQ(expected, options.optional_services); |
| 383 } | 394 } |
| 384 { | 395 { |
| 385 // Single matching of many services in optional_services. | 396 // Single matching of many services in optional_services. |
| 386 blink::mojom::WebBluetoothRequestDeviceOptions options; | 397 blink::mojom::WebBluetoothRequestDeviceOptions options; |
| 387 options.optional_services.push_back(Canonicalize("0000")); | 398 options.optional_services.push_back(BluetoothUUID("0000")); |
| 388 options.optional_services.push_back(Canonicalize("eeee")); | 399 options.optional_services.push_back(BluetoothUUID("eeee")); |
| 389 options.optional_services.push_back(Canonicalize("0001")); | 400 options.optional_services.push_back(BluetoothUUID("0001")); |
| 390 | 401 |
| 391 mojo::Array<base::Optional<BluetoothUUID>> expected; | 402 std::vector<BluetoothUUID> expected; |
| 392 expected.push_back(Canonicalize("0000")); | 403 expected.push_back(BluetoothUUID("0000")); |
| 393 expected.push_back(Canonicalize("0001")); | 404 expected.push_back(BluetoothUUID("0001")); |
| 394 | 405 |
| 395 list_.RemoveExcludedUUIDs(&options); | 406 list_.RemoveExcludedUUIDs(&options); |
| 396 EXPECT_TRUE(options.optional_services.Equals(expected)); | 407 EXPECT_EQ(expected, options.optional_services); |
| 397 } | 408 } |
| 398 { | 409 { |
| 399 // All matching of many services in optional_services. | 410 // All matching of many services in optional_services. |
| 400 blink::mojom::WebBluetoothRequestDeviceOptions options; | 411 blink::mojom::WebBluetoothRequestDeviceOptions options; |
| 401 options.optional_services.push_back(Canonicalize("eee2")); | 412 options.optional_services.push_back(BluetoothUUID("eee2")); |
| 402 options.optional_services.push_back(Canonicalize("eee4")); | 413 options.optional_services.push_back(BluetoothUUID("eee4")); |
| 403 options.optional_services.push_back(Canonicalize("eee3")); | 414 options.optional_services.push_back(BluetoothUUID("eee3")); |
| 404 options.optional_services.push_back(Canonicalize("eeee")); | 415 options.optional_services.push_back(BluetoothUUID("eeee")); |
| 405 | 416 |
| 406 mojo::Array<base::Optional<BluetoothUUID>> expected; | 417 std::vector<BluetoothUUID> expected; |
| 407 | 418 |
| 408 list_.RemoveExcludedUUIDs(&options); | 419 list_.RemoveExcludedUUIDs(&options); |
| 409 EXPECT_TRUE(options.optional_services.Equals(expected)); | 420 EXPECT_EQ(expected, options.optional_services); |
| 410 } | 421 } |
| 411 } | 422 } |
| 412 | 423 |
| 413 TEST_F(BluetoothBlocklistTest, VerifyDefaultBlocklistSize) { | 424 TEST_F(BluetoothBlocklistTest, VerifyDefaultBlocklistSize) { |
| 414 // REMINDER: ADD new blocklist items to tests below for each exclusion type. | 425 // REMINDER: ADD new blocklist items to tests below for each exclusion type. |
| 415 EXPECT_EQ(13u, list_.size()); | 426 EXPECT_EQ(13u, list_.size()); |
| 416 } | 427 } |
| 417 | 428 |
| 418 TEST_F(BluetoothBlocklistTest, VerifyDefaultExcludeList) { | 429 TEST_F(BluetoothBlocklistTest, VerifyDefaultExcludeList) { |
| 419 EXPECT_FALSE(list_.IsExcluded(BluetoothUUID("1800"))); | 430 EXPECT_FALSE(list_.IsExcluded(BluetoothUUID("1800"))); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 BluetoothUUID("bad1c9a2-9a5b-4015-8b60-1579bbbf2135"))); | 489 BluetoothUUID("bad1c9a2-9a5b-4015-8b60-1579bbbf2135"))); |
| 479 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2902"))); | 490 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2902"))); |
| 480 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2903"))); | 491 EXPECT_TRUE(list_.IsExcludedFromWrites(BluetoothUUID("2903"))); |
| 481 EXPECT_TRUE(list_.IsExcludedFromWrites( | 492 EXPECT_TRUE(list_.IsExcludedFromWrites( |
| 482 BluetoothUUID("bad2ddcf-60db-45cd-bef9-fd72b153cf7c"))); | 493 BluetoothUUID("bad2ddcf-60db-45cd-bef9-fd72b153cf7c"))); |
| 483 EXPECT_FALSE(list_.IsExcludedFromWrites( | 494 EXPECT_FALSE(list_.IsExcludedFromWrites( |
| 484 BluetoothUUID("bad3ec61-3cc3-4954-9702-7977df514114"))); | 495 BluetoothUUID("bad3ec61-3cc3-4954-9702-7977df514114"))); |
| 485 } | 496 } |
| 486 | 497 |
| 487 } // namespace content | 498 } // namespace content |
| OLD | NEW |