| Index: content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc
|
| diff --git a/content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc b/content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc
|
| index 21ddd44083dede3ef1c1b4087e534d7d3e474c0b..7c4ee1a201656bbb5d9d4286de51c4353696c962 100644
|
| --- a/content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc
|
| +++ b/content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc
|
| @@ -4,9 +4,13 @@
|
|
|
| #include "content/browser/bluetooth/frame_connected_bluetooth_devices.h"
|
|
|
| +#include <memory>
|
| +
|
| #include "base/memory/ptr_util.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "content/browser/bluetooth/web_bluetooth_service_impl.h"
|
| +#include "content/public/browser/bluetooth_allowed_devices_map_base.h"
|
| +#include "content/public/browser/web_contents_delegate.h"
|
| #include "content/test/test_render_view_host.h"
|
| #include "content/test/test_web_contents.h"
|
| #include "device/bluetooth/bluetooth_gatt_connection.h"
|
| @@ -38,6 +42,21 @@ const WebBluetoothDeviceId kDeviceId1("111111111111111111111A==");
|
| constexpr char kDeviceAddress1[] = "1";
|
| constexpr char kDeviceName1[] = "Device1";
|
|
|
| +class MockWebContentsDelegate : public WebContentsDelegate {
|
| + public:
|
| + BluetoothAllowedDevicesMapBase* GetBluetoothDevicesMap(
|
| + RenderFrameHost* frame) override {
|
| + if (!bluetooth_allowed_devices_map_) {
|
| + bluetooth_allowed_devices_map_.reset(
|
| + new BluetoothAllowedDevicesMapBase());
|
| + }
|
| + return bluetooth_allowed_devices_map_.get();
|
| + }
|
| +
|
| + std::unique_ptr<BluetoothAllowedDevicesMapBase>
|
| + bluetooth_allowed_devices_map_;
|
| +};
|
| +
|
| } // namespace
|
|
|
| class FrameConnectedBluetoothDevicesTest
|
| @@ -69,6 +88,8 @@ class FrameConnectedBluetoothDevicesTest
|
| void SetUp() override {
|
| RenderViewHostImplTestHarness::SetUp();
|
|
|
| + contents()->SetDelegate(&mock_web_contents_delegate_);
|
| +
|
| // Create subframe to simulate two maps on the same WebContents.
|
| contents()->GetMainFrame()->InitializeRenderFrameIfNeeded();
|
| TestRenderFrameHost* subframe =
|
| @@ -119,6 +140,7 @@ class FrameConnectedBluetoothDevicesTest
|
| scoped_refptr<NiceMockBluetoothAdapter> adapter_;
|
| NiceMockBluetoothDevice device0_;
|
| NiceMockBluetoothDevice device1_;
|
| + MockWebContentsDelegate mock_web_contents_delegate_;
|
| };
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, Insert_Once) {
|
|
|