Index: content/browser/bluetooth/bluetooth_blacklist_unittest.cc |
diff --git a/content/browser/bluetooth/bluetooth_blacklist_unittest.cc b/content/browser/bluetooth/bluetooth_blacklist_unittest.cc |
index bc30ff8a823499bd0ae38d399407b895752b50f8..5c9b67410f7e138dbef9ce681f790dca37b22fa4 100644 |
--- a/content/browser/bluetooth/bluetooth_blacklist_unittest.cc |
+++ b/content/browser/bluetooth/bluetooth_blacklist_unittest.cc |
@@ -58,6 +58,30 @@ TEST_F(BluetoothBlacklistTest, ExcludeWritesUUID) { |
EXPECT_TRUE(blacklist.IsExcludedFromWrites(exclude_writes_uuid)); |
} |
+TEST_F(BluetoothBlacklistTest, InvalidUUID) { |
+ BluetoothBlacklist& blacklist = BluetoothBlacklist::Get(); |
+ BluetoothUUID empty_string_uuid(""); |
+ EXPECT_DEATH_IF_SUPPORTED( |
+ blacklist.AddOrDie(empty_string_uuid, BluetoothBlacklist::Value::EXCLUDE), |
+ ""); |
+ EXPECT_DEATH_IF_SUPPORTED(blacklist.IsExcluded(empty_string_uuid), ""); |
+ EXPECT_DEATH_IF_SUPPORTED(blacklist.IsExcludedFromReads(empty_string_uuid), |
+ ""); |
+ EXPECT_DEATH_IF_SUPPORTED(blacklist.IsExcludedFromWrites(empty_string_uuid), |
+ ""); |
+ |
+ BluetoothUUID invalid_string_uuid("Not a valid UUID string."); |
+ EXPECT_DEATH_IF_SUPPORTED( |
+ blacklist.AddOrDie(invalid_string_uuid, |
+ BluetoothBlacklist::Value::EXCLUDE), |
+ ""); |
+ EXPECT_DEATH_IF_SUPPORTED(blacklist.IsExcluded(invalid_string_uuid), ""); |
+ EXPECT_DEATH_IF_SUPPORTED(blacklist.IsExcludedFromReads(invalid_string_uuid), |
+ ""); |
+ EXPECT_DEATH_IF_SUPPORTED(blacklist.IsExcludedFromWrites(invalid_string_uuid), |
+ ""); |
+} |
+ |
// Abreviated UUIDs used to create, or test against, the blacklist work |
// correctly compared to full UUIDs. |
TEST_F(BluetoothBlacklistTest, AbreviatedUUIDs) { |