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

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

Issue 284183012: Bluetooth: remove Profile API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc
index 06ec55e2b894f02eddfe687615c14e060c695f86..d8c5ebd15cdeb3753d29c98e2a171c376b3f5858 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc
@@ -20,8 +20,6 @@
#include "device/bluetooth/bluetooth_uuid.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/bluetooth/test/mock_bluetooth_device.h"
-#include "device/bluetooth/test/mock_bluetooth_profile.h"
-#include "device/bluetooth/test/mock_bluetooth_socket.h"
#include "extensions/browser/event_router.h"
#include "extensions/common/extension_builder.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -63,8 +61,6 @@ class BluetoothEventRouterTest : public testing::Test {
// Note: |ui_thread_| must be declared before |router_|.
content::TestBrowserThread ui_thread_;
testing::StrictMock<device::MockBluetoothAdapter>* mock_adapter_;
- testing::NiceMock<device::MockBluetoothProfile> mock_audio_profile_;
- testing::NiceMock<device::MockBluetoothProfile> mock_health_profile_;
scoped_ptr<TestingProfile> test_profile_;
BluetoothEventRouter router_;
};
@@ -85,27 +81,6 @@ TEST_F(BluetoothEventRouterTest, MultipleBluetoothEventListeners) {
router_.OnListenerRemoved();
}
-TEST_F(BluetoothEventRouterTest, Profiles) {
- EXPECT_FALSE(router_.HasProfile(kAudioProfileUuid));
- EXPECT_FALSE(router_.HasProfile(kHealthProfileUuid));
-
- router_.AddProfile(
- kAudioProfileUuid, kTestExtensionId, &mock_audio_profile_);
- router_.AddProfile(
- kHealthProfileUuid, kTestExtensionId, &mock_health_profile_);
- EXPECT_TRUE(router_.HasProfile(kAudioProfileUuid));
- EXPECT_TRUE(router_.HasProfile(kHealthProfileUuid));
-
- EXPECT_CALL(mock_audio_profile_, Unregister()).Times(1);
- router_.RemoveProfile(kAudioProfileUuid);
- EXPECT_FALSE(router_.HasProfile(kAudioProfileUuid));
- EXPECT_TRUE(router_.HasProfile(kHealthProfileUuid));
-
- // Make sure remaining profiles are unregistered in destructor.
- EXPECT_CALL(mock_health_profile_, Unregister()).Times(1);
- EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
-}
-
TEST_F(BluetoothEventRouterTest, UnloadExtension) {
scoped_refptr<const extensions::Extension> extension =
extensions::ExtensionBuilder()
@@ -116,17 +91,6 @@ TEST_F(BluetoothEventRouterTest, UnloadExtension) {
.SetID(kTestExtensionId)
.Build();
- router_.AddProfile(
- kAudioProfileUuid, kTestExtensionId, &mock_audio_profile_);
- router_.AddProfile(
- kHealthProfileUuid, kTestExtensionId, &mock_health_profile_);
- EXPECT_TRUE(router_.HasProfile(kAudioProfileUuid));
- EXPECT_TRUE(router_.HasProfile(kHealthProfileUuid));
-
- // Unloading the extension should unregister all profiles added by it.
- EXPECT_CALL(mock_audio_profile_, Unregister()).Times(1);
- EXPECT_CALL(mock_health_profile_, Unregister()).Times(1);
-
content::NotificationService* notifier =
content::NotificationService::current();
UnloadedExtensionInfo details(
@@ -135,8 +99,6 @@ TEST_F(BluetoothEventRouterTest, UnloadExtension) {
content::Source<Profile>(test_profile_.get()),
content::Details<UnloadedExtensionInfo>(&details));
- EXPECT_FALSE(router_.HasProfile(kAudioProfileUuid));
- EXPECT_FALSE(router_.HasProfile(kHealthProfileUuid));
EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
}

Powered by Google App Engine
This is Rietveld 408576698