| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h" | 10 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 254 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 255 BluetoothAdapterTurnedOff) { | 255 BluetoothAdapterTurnedOff) { |
| 256 EXPECT_CALL( | 256 EXPECT_CALL( |
| 257 mock_bluetooth_chooser_view_, | 257 mock_bluetooth_chooser_view_, |
| 258 OnAdapterEnabledChanged(false /* Bluetooth adapter is turned off */)) | 258 OnAdapterEnabledChanged(false /* Bluetooth adapter is turned off */)) |
| 259 .Times(1); | 259 .Times(1); |
| 260 bluetooth_chooser_controller_.OnAdapterPresenceChanged( | 260 bluetooth_chooser_controller_.OnAdapterPresenceChanged( |
| 261 content::BluetoothChooser::AdapterPresence::POWERED_OFF); | 261 content::BluetoothChooser::AdapterPresence::POWERED_OFF); |
| 262 EXPECT_EQ(0u, bluetooth_chooser_controller_.NumOptions()); | 262 EXPECT_EQ(0u, bluetooth_chooser_controller_.NumOptions()); |
| 263 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_ADAPTER_OFF), | |
| 264 bluetooth_chooser_controller_.GetNoOptionsText()); | |
| 265 EXPECT_EQ(base::string16(), bluetooth_chooser_controller_.GetStatus()); | 263 EXPECT_EQ(base::string16(), bluetooth_chooser_controller_.GetStatus()); |
| 266 } | 264 } |
| 267 | 265 |
| 268 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 266 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 269 BluetoothAdapterTurnedOn) { | 267 BluetoothAdapterTurnedOn) { |
| 270 EXPECT_CALL( | 268 EXPECT_CALL( |
| 271 mock_bluetooth_chooser_view_, | 269 mock_bluetooth_chooser_view_, |
| 272 OnAdapterEnabledChanged(true /* Bluetooth adapter is turned on */)) | 270 OnAdapterEnabledChanged(true /* Bluetooth adapter is turned on */)) |
| 273 .Times(1); | 271 .Times(1); |
| 274 bluetooth_chooser_controller_.OnAdapterPresenceChanged( | 272 bluetooth_chooser_controller_.OnAdapterPresenceChanged( |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); | 330 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); |
| 333 EXPECT_EQ(std::string(), last_device_id_); | 331 EXPECT_EQ(std::string(), last_device_id_); |
| 334 } | 332 } |
| 335 | 333 |
| 336 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 334 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 337 CloseShouldCallEventHandler) { | 335 CloseShouldCallEventHandler) { |
| 338 bluetooth_chooser_controller_.Close(); | 336 bluetooth_chooser_controller_.Close(); |
| 339 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); | 337 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); |
| 340 EXPECT_EQ(std::string(), last_device_id_); | 338 EXPECT_EQ(std::string(), last_device_id_); |
| 341 } | 339 } |
| OLD | NEW |