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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc

Issue 402303002: bluetoothLowEnergy: Send onServiceAdded after all characteristics are discovered (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
index 78fd1ff2710f8818372fd57156a1b31041e076b8..07820c2d2b52e19647d4f2ffe063551844752363 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
@@ -330,9 +330,18 @@ IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, ServiceEvents) {
// Cause events to be sent to the extension.
event_router()->DeviceAdded(mock_adapter_, device0_.get());
+ // These will create the identifier mappings.
event_router()->GattServiceAdded(device0_.get(), service0_.get());
event_router()->GattServiceAdded(device0_.get(), service1_.get());
+
+ // These will send the onServiceAdded event to apps.
+ event_router()->GattDiscoveryCompleteForService(service0_.get());
+ event_router()->GattDiscoveryCompleteForService(service1_.get());
+
+ // This will send the onServiceChanged event to apps.
event_router()->GattServiceChanged(service1_.get());
+
+ // This will send the onServiceRemoved event to apps.
event_router()->GattServiceRemoved(device0_.get(), service0_.get());
EXPECT_TRUE(listener.WaitUntilSatisfied());
@@ -361,6 +370,7 @@ IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GetRemovedService) {
event_router()->DeviceAdded(mock_adapter_, device0_.get());
event_router()->GattServiceAdded(device0_.get(), service0_.get());
+ event_router()->GattDiscoveryCompleteForService(service0_.get());
ExtensionTestMessageListener get_service_success_listener("getServiceSuccess",
true);
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698