Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Unified Diff: content/browser/bluetooth/bluetooth_blacklist.cc

Issue 1737423002: bluetooth: Add Web Bluetooth blacklist checks to readValue & writeValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-blacklist-char-
Patch Set: addressed ortuno Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_blacklist_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_blacklist.cc
diff --git a/content/browser/bluetooth/bluetooth_blacklist.cc b/content/browser/bluetooth/bluetooth_blacklist.cc
index 94891db06da37000a3116ebe0e34ac19b01a1f9e..4fae87ca6b118bb53b9eb4a8b8e6c13ac95abf5a 100644
--- a/content/browser/bluetooth/bluetooth_blacklist.cc
+++ b/content/browser/bluetooth/bluetooth_blacklist.cc
@@ -95,17 +95,38 @@ void BluetoothBlacklist::PopulateWithDefaultValues() {
// Blacklist UUIDs updated 2016-02-12 from:
// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blacklist.txt
// Short UUIDs are used for readability of this list.
+ //
+ // Testing from Layout Tests Note:
+ //
+ // Random UUIDs for object & exclude permutations that do not exist in the
+ // standard blacklist are included to facilitate integration testing from
+ // Layout Tests. Unit tests can dynamically modify the blacklist, but don't
+ // offer the full integration test to the Web Bluetooth Javascript bindings.
+ //
+ // This is done for simplicity as opposed to exposing a testing API that can
+ // add to the blacklist over time, which would be over engineered.
+ //
+ // Remove testing UUIDs if the specified blacklist is updated to include UUIDs
+ // that match the specific permutations.
DCHECK(BluetoothUUID("00001800-0000-1000-8000-00805f9b34fb") ==
BluetoothUUID("1800"));
- // ## Services
+ // Services:
AddOrDie(BluetoothUUID("1812"), Value::EXCLUDE);
- // ## Characteristics
+ // Characteristics:
AddOrDie(BluetoothUUID("2a02"), Value::EXCLUDE_WRITES);
AddOrDie(BluetoothUUID("2a03"), Value::EXCLUDE);
AddOrDie(BluetoothUUID("2a25"), Value::EXCLUDE);
- // ## Descriptors
+ // Characteristics for Layout Tests:
+ AddOrDie(BluetoothUUID("bad1c9a2-9a5b-4015-8b60-1579bbbf2135"),
+ Value::EXCLUDE_READS);
+ // Descriptors:
AddOrDie(BluetoothUUID("2902"), Value::EXCLUDE_WRITES);
AddOrDie(BluetoothUUID("2903"), Value::EXCLUDE_WRITES);
+ // Descriptors for Layout Tests:
+ AddOrDie(BluetoothUUID("bad2ddcf-60db-45cd-bef9-fd72b153cf7c"),
+ Value::EXCLUDE);
+ AddOrDie(BluetoothUUID("bad3ec61-3cc3-4954-9702-7977df514114"),
+ Value::EXCLUDE_READS);
}
} // namespace content
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_blacklist_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698