| Index: chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc
|
| diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc
|
| index 6f5c7193a27e2e71ae107813a1149cbbe0ab0f07..98f1134f0fc41a5daadaea92f29ebd4e0feb7a52 100644
|
| --- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc
|
| +++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc
|
| @@ -88,6 +88,8 @@ TEST_F(BluetoothChooserControllerTest, AddDevice) {
|
| EXPECT_EQ(base::ASCIIToUTF16("a"),
|
| bluetooth_chooser_controller_.GetOption(0));
|
| EXPECT_EQ(-1, bluetooth_chooser_controller_.GetSignalStrengthLevel(0));
|
| + EXPECT_TRUE(bluetooth_chooser_controller_.IsConnected(0));
|
| + EXPECT_TRUE(bluetooth_chooser_controller_.IsPaired(0));
|
| testing::Mock::VerifyAndClearExpectations(&mock_bluetooth_chooser_view_);
|
|
|
| EXPECT_CALL(mock_bluetooth_chooser_view_, OnOptionAdded(1)).Times(1);
|
| @@ -243,6 +245,36 @@ TEST_F(BluetoothChooserControllerTest, UpdateDeviceSignalStrengthLevel) {
|
| EXPECT_EQ(1, bluetooth_chooser_controller_.GetSignalStrengthLevel(0));
|
| }
|
|
|
| +TEST_F(BluetoothChooserControllerTest, UpdateConnectedStatus) {
|
| + bluetooth_chooser_controller_.AddOrUpdateDevice(
|
| + "id_a", false /* should_update_name */, base::ASCIIToUTF16("a"),
|
| + false /* is_gatt_connected */, false /* is_paired */,
|
| + 1 /* signal_strength_level */);
|
| + EXPECT_FALSE(bluetooth_chooser_controller_.IsConnected(0));
|
| +
|
| + EXPECT_CALL(mock_bluetooth_chooser_view_, OnOptionUpdated(0)).Times(1);
|
| + bluetooth_chooser_controller_.AddOrUpdateDevice(
|
| + "id_a", false /* should_update_name */, base::ASCIIToUTF16("a"),
|
| + true /* is_gatt_connected */, false /* is_paired */,
|
| + -1 /* signal_strength_level */);
|
| + EXPECT_TRUE(bluetooth_chooser_controller_.IsConnected(0));
|
| +}
|
| +
|
| +TEST_F(BluetoothChooserControllerTest, UpdatePairedStatus) {
|
| + bluetooth_chooser_controller_.AddOrUpdateDevice(
|
| + "id_a", false /* should_update_name */, base::ASCIIToUTF16("a"),
|
| + true /* is_gatt_connected */, false /* is_paired */,
|
| + -1 /* signal_strength_level */);
|
| + EXPECT_FALSE(bluetooth_chooser_controller_.IsPaired(0));
|
| +
|
| + EXPECT_CALL(mock_bluetooth_chooser_view_, OnOptionUpdated(0)).Times(1);
|
| + bluetooth_chooser_controller_.AddOrUpdateDevice(
|
| + "id_a", false /* should_update_name */, base::ASCIIToUTF16("a"),
|
| + true /* is_gatt_connected */, true /* is_paired */,
|
| + -1 /* signal_strength_level */);
|
| + EXPECT_TRUE(bluetooth_chooser_controller_.IsPaired(0));
|
| +}
|
| +
|
| TEST_F(BluetoothChooserControllerWithDevicesAddedTest,
|
| InitialNoOptionsTextAndStatusText) {
|
| EXPECT_EQ(l10n_util::GetStringUTF16(
|
|
|