| 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..5051f362eec66de1cd30357c19ed503bdc2170d3 100644
|
| --- a/content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc
|
| +++ b/content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc
|
| @@ -122,23 +122,28 @@ class FrameConnectedBluetoothDevicesTest
|
| };
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, Insert_Once) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, Insert_Twice) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, Insert_TwoDevices) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -146,8 +151,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest, Insert_TwoDevices) {
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, Insert_TwoMaps) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map1_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map1_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -156,7 +163,8 @@ TEST_F(FrameConnectedBluetoothDevicesTest, Insert_TwoMaps) {
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest,
|
| CloseConnectionId_OneDevice_AddOnce_RemoveOnce) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -169,7 +177,8 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest,
|
| CloseConnectionId_OneDevice_AddOnce_RemoveTwice) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -183,8 +192,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest,
|
| CloseConnectionId_OneDevice_AddTwice_RemoveOnce) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -197,8 +208,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest,
|
| CloseConnectionId_OneDevice_AddTwice_RemoveTwice) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -211,8 +224,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionId_TwoDevices) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -230,8 +245,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionId_TwoDevices) {
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionId_TwoMaps) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map1_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map1_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -250,7 +267,8 @@ TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionId_TwoMaps) {
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest,
|
| CloseConnectionAddress_OneDevice_AddOnce_RemoveOnce) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -264,7 +282,8 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest,
|
| CloseConnectionAddress_OneDevice_AddOnce_RemoveTwice) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -279,8 +298,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest,
|
| CloseConnectionAddress_OneDevice_AddTwice_RemoveOnce) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -294,8 +315,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest,
|
| CloseConnectionAddress_OneDevice_AddTwice_RemoveTwice) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -309,8 +332,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionAddress_TwoDevices) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -331,8 +356,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionAddress_TwoDevices) {
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionAddress_TwoMaps) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map1_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map1_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
| EXPECT_TRUE(map0_->IsConnectedToDeviceWithId(kDeviceId0));
|
| @@ -353,8 +380,10 @@ TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionAddress_TwoMaps) {
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, Destruction_MultipleDevices) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
|
|
| @@ -364,11 +393,15 @@ TEST_F(FrameConnectedBluetoothDevicesTest, Destruction_MultipleDevices) {
|
| }
|
|
|
| TEST_F(FrameConnectedBluetoothDevicesTest, Destruction_MultipleMaps) {
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map0_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| - map1_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| - map1_->Insert(kDeviceId1, GetConnection(kDeviceAddress1));
|
| + map1_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| + map1_->Insert(kDeviceId1, GetConnection(kDeviceAddress1),
|
| + nullptr /* client_request */);
|
|
|
| EXPECT_TRUE(contents()->IsConnectedToBluetoothDevice());
|
|
|
| @@ -387,7 +420,8 @@ TEST_F(FrameConnectedBluetoothDevicesTest,
|
| // Tests that we don't crash when FrameConnectedBluetoothDevices contains
|
| // at least one device, and it is destroyed while WebContentsImpl is being
|
| // destroyed.
|
| - map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
|
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0),
|
| + nullptr /* client_request */);
|
| DeleteContents();
|
| }
|
|
|
|
|