Chromium Code Reviews| 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 8a76e565ece2ceb803e3735b600ea634bcf18f3c..3d08128e84975a0a958909a14ebbf06ac1a06422 100644 |
| --- a/content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc |
| +++ b/content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc |
| @@ -354,4 +354,19 @@ TEST_F(FrameConnectedBluetoothDevicesTest, Destruction_MultipleMaps) { |
| EXPECT_FALSE(contents()->IsConnectedToBluetoothDevice()); |
| } |
| +TEST_F(FrameConnectedBluetoothDevicesTest, WebContentsImpl_Destruction) { |
|
Jeffrey Yasskin
2016/06/06 16:55:36
It's good to write the overall meaning of the test
ortuno
2016/06/06 18:25:16
Done.
|
| + // Tests that we don't crash when FrameConnectedBluetoothDeviceTest is |
|
Jeffrey Yasskin
2016/06/06 16:55:36
Did you mean FrameConnectedBluetoothDevices here?
ortuno
2016/06/06 18:25:16
Done.
|
| + // destroyed while WebContentsImpl is being destroyed. |
|
Jeffrey Yasskin
2016/06/06 16:55:36
It's not just "while", right? It's when FrameConne
ortuno
2016/06/06 18:25:16
Done.
|
| + |
| + map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0)); |
| + // A FrameConnectedBluetoothDevices instance is usually owned by a |
| + // WebBluetoothServiceImpl instance which is owned by a RenderFrameHost which |
| + // is owned by WebContentsImpl. In order to avoid adding unnecessary |
| + // complexity to WebBluetoothServiceImpl just so we can perform this test we |
| + // add the map directly to a frame and then delete WebContents. |
| + contents()->GetMainFrame()->SetFrameConnectedBluetoothDevices( |
| + std::move(map0_)); |
| + DeleteContents(); |
| +} |
| + |
| } // namespace content |