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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc

Issue 2801403002: MD Settings: Bluetooth: Fix adapter state and discovery (Closed)
Patch Set: Use CHECK instead of early exit Created 3 years, 8 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
Index: extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc b/extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc
index 2b402d5a14d9756d4bd807955b6f453aab0acdec..bcee0bd675dbc346abf877bb310d033cef3c3f83 100644
--- a/extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc
@@ -15,6 +15,7 @@
#include "device/bluetooth/bluetooth_common.h"
#include "device/bluetooth/bluetooth_uuid.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
+#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extensions_test.h"
#include "extensions/common/api/bluetooth.h"
@@ -59,19 +60,22 @@ class BluetoothEventRouterTest : public ExtensionsTest {
};
TEST_F(BluetoothEventRouterTest, BluetoothEventListener) {
- router_->OnListenerAdded();
+ EventListenerInfo info("", "", GURL(), nullptr);
+ router_->OnListenerAdded(info);
EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
- router_->OnListenerRemoved();
+ router_->OnListenerRemoved(info);
}
TEST_F(BluetoothEventRouterTest, MultipleBluetoothEventListeners) {
- router_->OnListenerAdded();
- router_->OnListenerAdded();
- router_->OnListenerAdded();
- router_->OnListenerRemoved();
- router_->OnListenerRemoved();
+ // TODO(rkc/stevenjb): Test multiple extensions and WebUI.
+ EventListenerInfo info("", "", GURL(), nullptr);
+ router_->OnListenerAdded(info);
+ router_->OnListenerAdded(info);
+ router_->OnListenerAdded(info);
+ router_->OnListenerRemoved(info);
+ router_->OnListenerRemoved(info);
EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
- router_->OnListenerRemoved();
+ router_->OnListenerRemoved(info);
}
TEST_F(BluetoothEventRouterTest, UnloadExtension) {
« no previous file with comments | « extensions/browser/api/bluetooth/bluetooth_event_router.cc ('k') | extensions/browser/api/bluetooth/bluetooth_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698