Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1217)

Unified Diff: device/bluetooth/bluetooth_chromeos_unittest.cc

Issue 1124883004: Submission for C++ Readability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address first round of review comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_chromeos_unittest.cc
diff --git a/device/bluetooth/bluetooth_chromeos_unittest.cc b/device/bluetooth/bluetooth_chromeos_unittest.cc
index a4bcb8a4cb41e1e20a1059293357b35d72e22257..0262c6b1350bf2a42230b5b6ef98d19d4dc2b2c8 100644
--- a/device/bluetooth/bluetooth_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_chromeos_unittest.cc
@@ -139,14 +139,15 @@ class TestPairingDelegate : public BluetoothDevice::PairingDelegate {
uint32 last_entered_;
std::string last_pincode_;
- private:
- // Some tests use a message loop since background processing is simulated;
- // break out of those loops.
- void QuitMessageLoop() {
- if (base::MessageLoop::current() &&
- base::MessageLoop::current()->is_running())
- base::MessageLoop::current()->Quit();
- }
+ private:
+ // Some tests use a message loop since background processing is simulated;
+ // break out of those loops.
+ void QuitMessageLoop() {
+ if (base::MessageLoop::current() &&
+ base::MessageLoop::current()->is_running()) {
+ base::MessageLoop::current()->Quit();
+ }
+ }
};
class BluetoothChromeOSTest : public testing::Test {
@@ -194,7 +195,7 @@ class BluetoothChromeOSTest : public testing::Test {
ASSERT_EQ(1, callback_count_);
}
discovery_sessions_.clear();
- adapter_ = NULL;
+ adapter_ = nullptr;
DBusThreadManager::Shutdown();
}
@@ -261,7 +262,7 @@ class BluetoothChromeOSTest : public testing::Test {
// Call to fill the adapter_ member with a BluetoothAdapter instance.
void GetAdapter() {
adapter_ = new BluetoothAdapterChromeOS();
- ASSERT_TRUE(adapter_.get() != NULL);
+ ASSERT_TRUE(adapter_.get() != nullptr);
ASSERT_TRUE(adapter_->IsInitialized());
}
@@ -271,8 +272,8 @@ class BluetoothChromeOSTest : public testing::Test {
// The correct behavior of discovery is tested by the "Discovery" test case
// without using this function.
void DiscoverDevice(const std::string& address) {
- ASSERT_TRUE(adapter_.get() != NULL);
- ASSERT_TRUE(base::MessageLoop::current() != NULL);
+ ASSERT_TRUE(adapter_.get() != nullptr);
+ ASSERT_TRUE(base::MessageLoop::current() != nullptr);
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
TestBluetoothAdapterObserver observer(adapter_);
@@ -330,8 +331,9 @@ class BluetoothChromeOSTest : public testing::Test {
// break out of those loops.
void QuitMessageLoop() {
if (base::MessageLoop::current() &&
- base::MessageLoop::current()->is_running())
+ base::MessageLoop::current()->is_running()) {
base::MessageLoop::current()->Quit();
+ }
}
};
@@ -1373,7 +1375,7 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscovery) {
ASSERT_EQ((size_t)1, discovery_sessions_.size());
ASSERT_FALSE(discovery_sessions_[0]->IsActive());
ASSERT_EQ(discovery_sessions_[0]->GetDiscoveryFilter(),
- (BluetoothDiscoveryFilter*)NULL);
+ (BluetoothDiscoveryFilter*)nullptr);
filter = fake_bluetooth_adapter_client_->GetDiscoveryFilter();
EXPECT_EQ(nullptr, filter);
@@ -1512,10 +1514,10 @@ TEST_F(BluetoothChromeOSTest, QueuedSetDiscoveryFilterBeforeStartDiscovery) {
ASSERT_FALSE(adapter_->IsDiscovering());
ASSERT_FALSE(discovery_sessions_[0]->IsActive());
ASSERT_EQ(discovery_sessions_[0]->GetDiscoveryFilter(),
- (BluetoothDiscoveryFilter*)NULL);
+ (BluetoothDiscoveryFilter*)nullptr);
ASSERT_FALSE(discovery_sessions_[1]->IsActive());
ASSERT_EQ(discovery_sessions_[1]->GetDiscoveryFilter(),
- (BluetoothDiscoveryFilter*)NULL);
+ (BluetoothDiscoveryFilter*)nullptr);
filter = fake_bluetooth_adapter_client_->GetDiscoveryFilter();
EXPECT_EQ(nullptr, filter);
@@ -1616,7 +1618,7 @@ TEST_F(BluetoothChromeOSTest,
ASSERT_FALSE(adapter_->IsDiscovering());
ASSERT_FALSE(discovery_sessions_[0]->IsActive());
ASSERT_EQ(discovery_sessions_[0]->GetDiscoveryFilter(),
- (BluetoothDiscoveryFilter*)NULL);
+ (BluetoothDiscoveryFilter*)nullptr);
filter = fake_bluetooth_adapter_client_->GetDiscoveryFilter();
EXPECT_EQ(nullptr, filter);
@@ -1650,9 +1652,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterAfterStartDiscovery) {
EXPECT_EQ(1, observer.discovering_changed_count());
observer.Reset();
- auto nullInstance = scoped_ptr<BluetoothDiscoveryFilter>();
- nullInstance.reset();
- ASSERT_EQ(discovery_sessions_[0]->GetDiscoveryFilter(), nullInstance.get());
+ auto null_instance = scoped_ptr<BluetoothDiscoveryFilter>();
+ null_instance.reset();
+ ASSERT_EQ(discovery_sessions_[0]->GetDiscoveryFilter(), null_instance.get());
auto filter = fake_bluetooth_adapter_client_->GetDiscoveryFilter();
EXPECT_EQ(nullptr, filter);
@@ -1699,7 +1701,7 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterAfterStartDiscovery) {
ASSERT_EQ((size_t)1, discovery_sessions_.size());
ASSERT_FALSE(discovery_sessions_[0]->IsActive());
ASSERT_EQ(discovery_sessions_[0]->GetDiscoveryFilter(),
- (BluetoothDiscoveryFilter*)NULL);
+ (BluetoothDiscoveryFilter*)nullptr);
filter = fake_bluetooth_adapter_client_->GetDiscoveryFilter();
EXPECT_EQ(nullptr, filter);
@@ -2210,11 +2212,11 @@ TEST_F(BluetoothChromeOSTest, ForgetUnpairedDevice) {
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kConnectUnpairableAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
// Connect the device so it becomes trusted and remembered.
- device->Connect(NULL, GetCallback(),
+ device->Connect(nullptr, GetCallback(),
base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback,
base::Unretained(this)));
@@ -2245,7 +2247,7 @@ TEST_F(BluetoothChromeOSTest, ForgetUnpairedDevice) {
// GetDevices shouldn't return the device either.
device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kConnectUnpairableAddress);
- EXPECT_FALSE(device != NULL);
+ EXPECT_FALSE(device != nullptr);
}
TEST_F(BluetoothChromeOSTest, ConnectPairedDevice) {
@@ -2253,14 +2255,14 @@ TEST_F(BluetoothChromeOSTest, ConnectPairedDevice) {
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kPairedDeviceAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_TRUE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
// Connect without a pairing delegate; since the device is already Paired
// this should succeed and the device should become connected.
- device->Connect(NULL, GetCallback(),
+ device->Connect(nullptr, GetCallback(),
base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback,
base::Unretained(this)));
@@ -2282,14 +2284,14 @@ TEST_F(BluetoothChromeOSTest, ConnectUnpairableDevice) {
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kConnectUnpairableAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
// Connect without a pairing delegate; since the device does not require
// pairing, this should succeed and the device should become connected.
- device->Connect(NULL, GetCallback(),
+ device->Connect(nullptr, GetCallback(),
base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback,
base::Unretained(this)));
@@ -2322,10 +2324,10 @@ TEST_F(BluetoothChromeOSTest, ConnectConnectedDevice) {
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kPairedDeviceAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_TRUE(device->IsPaired());
- device->Connect(NULL, GetCallback(),
+ device->Connect(nullptr, GetCallback(),
base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback,
base::Unretained(this)));
@@ -2339,7 +2341,7 @@ TEST_F(BluetoothChromeOSTest, ConnectConnectedDevice) {
// anything to initiate the connection.
TestBluetoothAdapterObserver observer(adapter_);
- device->Connect(NULL, GetCallback(),
+ device->Connect(nullptr, GetCallback(),
base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback,
base::Unretained(this)));
@@ -2360,14 +2362,14 @@ TEST_F(BluetoothChromeOSTest, ConnectDeviceFails) {
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kLegacyAutopairAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
// Connect without a pairing delegate; since the device requires pairing,
// this should fail with an error.
- device->Connect(NULL, GetCallback(),
+ device->Connect(nullptr, GetCallback(),
base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback,
base::Unretained(this)));
@@ -2386,10 +2388,10 @@ TEST_F(BluetoothChromeOSTest, DisconnectDevice) {
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kPairedDeviceAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_TRUE(device->IsPaired());
- device->Connect(NULL, GetCallback(),
+ device->Connect(nullptr, GetCallback(),
base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback,
base::Unretained(this)));
@@ -2420,7 +2422,7 @@ TEST_F(BluetoothChromeOSTest, DisconnectUnconnectedDevice) {
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kPairedDeviceAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_TRUE(device->IsPaired());
ASSERT_FALSE(device->IsConnected());
@@ -2448,7 +2450,7 @@ TEST_F(BluetoothChromeOSTest, PairLegacyAutopair) {
// the daemon provides 0000 to the device for us.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kLegacyAutopairAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2499,7 +2501,7 @@ TEST_F(BluetoothChromeOSTest, PairDisplayPinCode) {
// Requires that we display a randomly generated PIN on the screen.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kDisplayPinCodeAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2553,7 +2555,7 @@ TEST_F(BluetoothChromeOSTest, PairDisplayPasskey) {
// and notifies us as it's typed in.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kDisplayPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2573,7 +2575,7 @@ TEST_F(BluetoothChromeOSTest, PairDisplayPasskey) {
EXPECT_TRUE(device->IsConnecting());
// One call to KeysEntered() for each key, including [enter].
- for(int i = 1; i <= 7; ++i) {
+ for (int i = 1; i <= 7; ++i) {
message_loop_.Run();
EXPECT_EQ(2 + i, pairing_delegate.call_count_);
@@ -2627,7 +2629,7 @@ TEST_F(BluetoothChromeOSTest, PairRequestPinCode) {
// Requires that the user enters a PIN for them.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPinCodeAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2681,7 +2683,7 @@ TEST_F(BluetoothChromeOSTest, PairConfirmPasskey) {
// Requests that we confirm a displayed passkey.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kConfirmPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2733,7 +2735,7 @@ TEST_F(BluetoothChromeOSTest, PairRequestPasskey) {
// device that has a display, but doesn't use "just works" - maybe a car?
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2784,7 +2786,7 @@ TEST_F(BluetoothChromeOSTest, PairJustWorks) {
// interaction is required.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kJustWorksAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2829,7 +2831,7 @@ TEST_F(BluetoothChromeOSTest, PairUnpairableDeviceFails) {
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kUnpairableDeviceAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2864,7 +2866,7 @@ TEST_F(BluetoothChromeOSTest, PairingFails) {
// The vanishing device times out during pairing
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kVanishingDeviceAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2900,7 +2902,7 @@ TEST_F(BluetoothChromeOSTest, PairingFailsAtConnection) {
// it pairs, but then you can't make connections to it after.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kUnconnectableDeviceAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2947,7 +2949,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtPinCode) {
// Reject the pairing after we receive a request for the PIN code.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPinCodeAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -2985,7 +2987,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtPinCode) {
// Cancel the pairing after we receive a request for the PIN code.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPinCodeAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3023,7 +3025,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtPasskey) {
// Reject the pairing after we receive a request for the passkey.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3061,7 +3063,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtPasskey) {
// Cancel the pairing after we receive a request for the passkey.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3099,7 +3101,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtConfirmation) {
// Reject the pairing after we receive a request for passkey confirmation.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kConfirmPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3137,7 +3139,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtConfirmation) {
// Cancel the pairing after we receive a request for the passkey.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kConfirmPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3175,7 +3177,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledInFlight) {
// Cancel the pairing while we're waiting for the remote host.
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kLegacyAutopairAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3219,7 +3221,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCode) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kRequestPinCodePath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPinCodeAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3254,7 +3256,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCode) {
// No pairing context should remain on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
}
TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskey) {
@@ -3273,7 +3275,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskey) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kConfirmPasskeyPath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kConfirmPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3309,7 +3311,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskey) {
// No pairing context should remain on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
}
TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskey) {
@@ -3328,7 +3330,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskey) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kRequestPasskeyPath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3363,7 +3365,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskey) {
// No pairing context should remain on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
}
TEST_F(BluetoothChromeOSTest, IncomingPairJustWorks) {
@@ -3383,7 +3385,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairJustWorks) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kJustWorksPath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kJustWorksAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3418,7 +3420,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairJustWorks) {
// No pairing context should remain on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
}
TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCodeWithoutDelegate) {
@@ -3433,7 +3435,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCodeWithoutDelegate) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kRequestPinCodePath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPinCodeAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3457,7 +3459,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCodeWithoutDelegate) {
// No pairing context should remain on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
}
TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskeyWithoutDelegate) {
@@ -3472,7 +3474,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskeyWithoutDelegate) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kConfirmPasskeyPath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kConfirmPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3496,7 +3498,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskeyWithoutDelegate) {
// No pairing context should remain on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
}
TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskeyWithoutDelegate) {
@@ -3511,7 +3513,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskeyWithoutDelegate) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kRequestPasskeyPath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3535,7 +3537,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskeyWithoutDelegate) {
// No pairing context should remain on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
}
TEST_F(BluetoothChromeOSTest, IncomingPairJustWorksWithoutDelegate) {
@@ -3550,7 +3552,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairJustWorksWithoutDelegate) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kJustWorksPath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kJustWorksAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3574,7 +3576,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairJustWorksWithoutDelegate) {
// No pairing context should remain on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
}
TEST_F(BluetoothChromeOSTest, RemovePairingDelegateDuringPairing) {
@@ -3593,7 +3595,7 @@ TEST_F(BluetoothChromeOSTest, RemovePairingDelegateDuringPairing) {
dbus::ObjectPath(FakeBluetoothDeviceClient::kRequestPasskeyPath));
BluetoothDevice* device = adapter_->GetDevice(
FakeBluetoothDeviceClient::kRequestPasskeyAddress);
- ASSERT_TRUE(device != NULL);
+ ASSERT_TRUE(device != nullptr);
ASSERT_FALSE(device->IsPaired());
TestBluetoothAdapterObserver observer(adapter_);
@@ -3609,12 +3611,12 @@ TEST_F(BluetoothChromeOSTest, RemovePairingDelegateDuringPairing) {
// A pairing context should now be set on the device.
BluetoothDeviceChromeOS* device_chromeos =
static_cast<BluetoothDeviceChromeOS*>(device);
- ASSERT_TRUE(device_chromeos->GetPairing() != NULL);
+ ASSERT_TRUE(device_chromeos->GetPairing() != nullptr);
// Removing the pairing delegate should remove that pairing context.
adapter_->RemovePairingDelegate(&pairing_delegate);
- EXPECT_TRUE(device_chromeos->GetPairing() == NULL);
+ EXPECT_TRUE(device_chromeos->GetPairing() == nullptr);
// Set the Passkey, this should now have no effect since the pairing has
// been, in-effect, cancelled
@@ -3638,8 +3640,8 @@ TEST_F(BluetoothChromeOSTest, DeviceId) {
fake_bluetooth_device_client_->GetProperties(
dbus::ObjectPath(FakeBluetoothDeviceClient::kPairedDevicePath));
- ASSERT_TRUE(device != NULL);
- ASSERT_TRUE(properties != NULL);
+ ASSERT_TRUE(device != nullptr);
+ ASSERT_TRUE(properties != nullptr);
// Valid USB IF-assigned identifier.
ASSERT_EQ("usb:v05ACp030Dd0306", properties->modalias.value());
@@ -3703,7 +3705,7 @@ TEST_F(BluetoothChromeOSTest, GetConnectionInfoForConnectedDevice) {
BluetoothDevice* device =
adapter_->GetDevice(FakeBluetoothDeviceClient::kPairedDeviceAddress);
- device->Connect(NULL, GetCallback(),
+ device->Connect(nullptr, GetCallback(),
base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback,
base::Unretained(this)));
EXPECT_TRUE(device->IsConnected());
@@ -3799,7 +3801,8 @@ TEST_F(BluetoothChromeOSTest, Shutdown) {
BluetoothAdapterChromeOS* adapter_chrome_os =
static_cast<BluetoothAdapterChromeOS*>(adapter_.get());
- EXPECT_EQ(NULL, adapter_chrome_os->GetDeviceWithPath(dbus::ObjectPath("")));
+ EXPECT_EQ(nullptr,
+ adapter_chrome_os->GetDeviceWithPath(dbus::ObjectPath("")));
// Notify methods presume objects exist that are owned by the adapter and
// destroyed in Shutdown(). Mocks are not attempted here that won't exist,
@@ -3818,7 +3821,7 @@ TEST_F(BluetoothChromeOSTest, Shutdown) {
EXPECT_EQ(dbus::ObjectPath(""), adapter_chrome_os->object_path());
- adapter_profile_ = NULL;
+ adapter_profile_ = nullptr;
FakeBluetoothProfileServiceProviderDelegate profile_delegate;
adapter_chrome_os->UseProfile(
@@ -3894,7 +3897,7 @@ TEST_F(BluetoothChromeOSTest, Shutdown) {
// OnStopDiscovery tested in Shutdown_OnStopDiscovery
// OnStopDiscoveryError tested in Shutdown_OnStopDiscoveryError
- adapter_profile_ = NULL;
+ adapter_profile_ = nullptr;
// OnRegisterProfile SetProfileDelegate, OnRegisterProfileError, require
// UseProfile to be set first, do so again here just before calling them.
@@ -4041,3 +4044,4 @@ TEST_F(BluetoothChromeOSTest, Shutdown_OnStopDiscoveryError) {
}
} // namespace chromeos
+

Powered by Google App Engine
This is Rietveld 408576698