| Index: chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc
|
| ===================================================================
|
| --- chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc (revision 170888)
|
| +++ chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc (working copy)
|
| @@ -330,7 +330,6 @@
|
| discovery_stopped.Reply("go");
|
|
|
| EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
|
| - CloseShellWindowsAndWaitForAppToExit();
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_F(BluetoothApiTest, DiscoveryInProgress) {
|
| @@ -361,7 +360,6 @@
|
| discovery_stopped.Reply("go");
|
|
|
| EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
|
| - CloseShellWindowsAndWaitForAppToExit();
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_F(BluetoothApiTest, Events) {
|
| @@ -383,7 +381,6 @@
|
| listener.Reply("go");
|
|
|
| EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
|
| - CloseShellWindowsAndWaitForAppToExit();
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevices) {
|
| @@ -417,7 +414,6 @@
|
| listener.Reply("go");
|
|
|
| EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
|
| - CloseShellWindowsAndWaitForAppToExit();
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevicesConcurrently) {
|
| @@ -429,10 +425,9 @@
|
|
|
| // Save the callback to delay execution so that we can force the calls to
|
| // happen concurrently. This will be called after the listener is satisfied.
|
| - BluetoothDevice::ProvidesServiceCallback* callback =
|
| - new BluetoothDevice::ProvidesServiceCallback;
|
| + BluetoothDevice::ProvidesServiceCallback callback;
|
| EXPECT_CALL(*device1_, ProvidesServiceWithName(testing::_, testing::_))
|
| - .WillOnce(testing::SaveArg<1>(callback));
|
| + .WillOnce(testing::SaveArg<1>(&callback));
|
|
|
| EXPECT_CALL(*mock_adapter_, GetDevices())
|
| .WillOnce(testing::Return(devices));
|
| @@ -443,12 +438,10 @@
|
| test_data_dir_.AppendASCII("bluetooth/get_devices_concurrently")));
|
| EXPECT_TRUE(listener.WaitUntilSatisfied());
|
|
|
| - callback->Run(false);
|
| - delete callback;
|
| + callback.Run(false);
|
| listener.Reply("go");
|
|
|
| EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
|
| - CloseShellWindowsAndWaitForAppToExit();
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevicesError) {
|
| @@ -464,5 +457,4 @@
|
| listener.Reply("go");
|
|
|
| EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
|
| - CloseShellWindowsAndWaitForAppToExit();
|
| }
|
|
|