Commit 98b5b1fe authored by Ryan Hansberry's avatar Ryan Hansberry Committed by Commit Bot

[Nearby] Rename MockBluetoothAdapter to FakeAdapter.

Rename to reflect the name of the superclass and the behavior of this
test object.

Bug: b:154849033, b:158848873
Change-Id: I50afc1508f7d1a6401e01b7102ef753339656aac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2317004
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarAlex Chau <alexchau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793539}
parent 2fcbee98
......@@ -13,7 +13,7 @@
#include "base/run_loop.h"
#include "base/test/bind_test_util.h"
#include "base/test/task_environment.h"
#include "chrome/services/sharing/nearby/test_support/mock_bluetooth_adapter.h"
#include "chrome/services/sharing/nearby/test_support/fake_adapter.h"
#include "chrome/services/sharing/nearby/test_support/mock_webrtc_dependencies.h"
#include "chrome/services/sharing/public/mojom/nearby_decoder.mojom.h"
#include "mojo/public/cpp/bindings/receiver.h"
......@@ -81,7 +81,7 @@ class NearbyConnectionsTest : public testing::Test {
protected:
base::test::TaskEnvironment task_environment_;
mojo::Remote<mojom::NearbyConnections> remote_;
bluetooth::MockBluetoothAdapter bluetooth_adapter_;
bluetooth::FakeAdapter bluetooth_adapter_;
sharing::MockWebRtcDependencies webrtc_dependencies_;
std::unique_ptr<NearbyConnections> nearby_connections_;
testing::NiceMock<MockServiceController>* service_controller_ptr_;
......
......@@ -6,8 +6,8 @@ source_set("test_support") {
testonly = true
sources = [
"mock_bluetooth_adapter.cc",
"mock_bluetooth_adapter.h",
"fake_adapter.cc",
"fake_adapter.h",
"mock_webrtc_dependencies.cc",
"mock_webrtc_dependencies.h",
]
......
......@@ -2,29 +2,29 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/services/sharing/nearby/test_support/mock_bluetooth_adapter.h"
#include "chrome/services/sharing/nearby/test_support/fake_adapter.h"
namespace bluetooth {
MockBluetoothAdapter::MockBluetoothAdapter() = default;
FakeAdapter::FakeAdapter() = default;
MockBluetoothAdapter::~MockBluetoothAdapter() = default;
FakeAdapter::~FakeAdapter() = default;
void MockBluetoothAdapter::ConnectToDevice(const std::string& address,
ConnectToDeviceCallback callback) {}
void FakeAdapter::ConnectToDevice(const std::string& address,
ConnectToDeviceCallback callback) {}
void MockBluetoothAdapter::GetDevices(GetDevicesCallback callback) {}
void FakeAdapter::GetDevices(GetDevicesCallback callback) {}
void MockBluetoothAdapter::GetInfo(GetInfoCallback callback) {
void FakeAdapter::GetInfo(GetInfoCallback callback) {
mojom::AdapterInfoPtr adapter_info = mojom::AdapterInfo::New();
adapter_info->present = present;
std::move(callback).Run(std::move(adapter_info));
}
void MockBluetoothAdapter::SetClient(
void FakeAdapter::SetClient(
::mojo::PendingRemote<mojom::AdapterClient> client) {}
void MockBluetoothAdapter::StartDiscoverySession(
void FakeAdapter::StartDiscoverySession(
StartDiscoverySessionCallback callback) {}
} // namespace bluetooth
......@@ -2,20 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_SERVICES_SHARING_NEARBY_TEST_SUPPORT_MOCK_BLUETOOTH_ADAPTER_H_
#define CHROME_SERVICES_SHARING_NEARBY_TEST_SUPPORT_MOCK_BLUETOOTH_ADAPTER_H_
#ifndef CHROME_SERVICES_SHARING_NEARBY_TEST_SUPPORT_FAKE_ADAPTER_H_
#define CHROME_SERVICES_SHARING_NEARBY_TEST_SUPPORT_FAKE_ADAPTER_H_
#include "device/bluetooth/public/mojom/adapter.mojom.h"
#include "mojo/public/cpp/bindings/receiver.h"
namespace bluetooth {
class MockBluetoothAdapter : public mojom::Adapter {
class FakeAdapter : public mojom::Adapter {
public:
MockBluetoothAdapter();
MockBluetoothAdapter(const MockBluetoothAdapter&) = delete;
MockBluetoothAdapter& operator=(const MockBluetoothAdapter&) = delete;
~MockBluetoothAdapter() override;
FakeAdapter();
FakeAdapter(const FakeAdapter&) = delete;
FakeAdapter& operator=(const FakeAdapter&) = delete;
~FakeAdapter() override;
// mojom::Adapter
void ConnectToDevice(const std::string& address,
......@@ -31,4 +31,4 @@ class MockBluetoothAdapter : public mojom::Adapter {
} // namespace bluetooth
#endif // CHROME_SERVICES_SHARING_NEARBY_TEST_SUPPORT_MOCK_BLUETOOTH_ADAPTER_H_
#endif // CHROME_SERVICES_SHARING_NEARBY_TEST_SUPPORT_FAKE_ADAPTER_H_
......@@ -10,7 +10,7 @@
#include "base/test/bind_test_util.h"
#include "base/test/task_environment.h"
#include "chrome/services/sharing/nearby/nearby_connections.h"
#include "chrome/services/sharing/nearby/test_support/mock_bluetooth_adapter.h"
#include "chrome/services/sharing/nearby/test_support/fake_adapter.h"
#include "chrome/services/sharing/nearby/test_support/mock_webrtc_dependencies.h"
#include "chrome/services/sharing/public/mojom/nearby_decoder.mojom.h"
#include "chrome/services/sharing/webrtc/test/mock_sharing_connection_host.h"
......@@ -128,7 +128,7 @@ TEST_F(SharingImplTest, ClosesPeerConnection) {
}
TEST_F(SharingImplTest, NearbyConnections_Create) {
bluetooth::MockBluetoothAdapter bluetooth_adapter;
bluetooth::FakeAdapter bluetooth_adapter;
sharing::MockWebRtcDependencies webrtc_dependencies;
mojo::Remote<NearbyConnectionsMojom> connections = CreateNearbyConnections(
bluetooth_adapter.adapter.BindNewPipeAndPassRemote(),
......@@ -141,7 +141,7 @@ TEST_F(SharingImplTest, NearbyConnections_Create) {
}
TEST_F(SharingImplTest, NearbyConnections_CreateMultiple) {
bluetooth::MockBluetoothAdapter bluetooth_adapter_1;
bluetooth::FakeAdapter bluetooth_adapter_1;
sharing::MockWebRtcDependencies webrtc_dependencies_1;
mojo::Remote<NearbyConnectionsMojom> connections_1 = CreateNearbyConnections(
bluetooth_adapter_1.adapter.BindNewPipeAndPassRemote(),
......@@ -152,7 +152,7 @@ TEST_F(SharingImplTest, NearbyConnections_CreateMultiple) {
EXPECT_TRUE(connections_1.is_connected());
// Calling CreateNearbyConnections() again should disconnect the old instance.
bluetooth::MockBluetoothAdapter bluetooth_adapter_2;
bluetooth::FakeAdapter bluetooth_adapter_2;
sharing::MockWebRtcDependencies webrtc_dependencies_2;
mojo::Remote<NearbyConnectionsMojom> connections_2 = CreateNearbyConnections(
bluetooth_adapter_2.adapter.BindNewPipeAndPassRemote(),
......@@ -169,7 +169,7 @@ TEST_F(SharingImplTest, NearbyConnections_CreateMultiple) {
}
TEST_F(SharingImplTest, NearbyConnections_BluetoothDisconnects) {
bluetooth::MockBluetoothAdapter bluetooth_adapter;
bluetooth::FakeAdapter bluetooth_adapter;
sharing::MockWebRtcDependencies webrtc_dependencies;
mojo::Remote<NearbyConnectionsMojom> connections = CreateNearbyConnections(
bluetooth_adapter.adapter.BindNewPipeAndPassRemote(),
......@@ -190,7 +190,7 @@ TEST_F(SharingImplTest, NearbyConnections_BluetoothDisconnects) {
}
TEST_F(SharingImplTest, NearbyConnections_WebRtcSignalingMessengerDisconnects) {
bluetooth::MockBluetoothAdapter bluetooth_adapter;
bluetooth::FakeAdapter bluetooth_adapter;
sharing::MockWebRtcDependencies webrtc_dependencies;
mojo::Remote<NearbyConnectionsMojom> connections = CreateNearbyConnections(
bluetooth_adapter.adapter.BindNewPipeAndPassRemote(),
......@@ -211,7 +211,7 @@ TEST_F(SharingImplTest, NearbyConnections_WebRtcSignalingMessengerDisconnects) {
}
TEST_F(SharingImplTest, NearbyConnections_WebRtcMdnsResponderDisconnects) {
bluetooth::MockBluetoothAdapter bluetooth_adapter;
bluetooth::FakeAdapter bluetooth_adapter;
sharing::MockWebRtcDependencies webrtc_dependencies;
mojo::Remote<NearbyConnectionsMojom> connections = CreateNearbyConnections(
bluetooth_adapter.adapter.BindNewPipeAndPassRemote(),
......@@ -232,7 +232,7 @@ TEST_F(SharingImplTest, NearbyConnections_WebRtcMdnsResponderDisconnects) {
}
TEST_F(SharingImplTest, NearbyConnections_WebRtcP2PSocketManagerDisconnects) {
bluetooth::MockBluetoothAdapter bluetooth_adapter;
bluetooth::FakeAdapter bluetooth_adapter;
sharing::MockWebRtcDependencies webrtc_dependencies;
mojo::Remote<NearbyConnectionsMojom> connections = CreateNearbyConnections(
bluetooth_adapter.adapter.BindNewPipeAndPassRemote(),
......@@ -253,7 +253,7 @@ TEST_F(SharingImplTest, NearbyConnections_WebRtcP2PSocketManagerDisconnects) {
}
TEST_F(SharingImplTest, NearbyConnections_WebRtcIceConfigFetcherDisconnects) {
bluetooth::MockBluetoothAdapter bluetooth_adapter;
bluetooth::FakeAdapter bluetooth_adapter;
sharing::MockWebRtcDependencies webrtc_dependencies;
mojo::Remote<NearbyConnectionsMojom> connections = CreateNearbyConnections(
bluetooth_adapter.adapter.BindNewPipeAndPassRemote(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment