| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 285 |
| 286 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 286 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 287 BluetoothAdapterTurnedOff) { | 287 BluetoothAdapterTurnedOff) { |
| 288 EXPECT_CALL( | 288 EXPECT_CALL( |
| 289 mock_bluetooth_chooser_view_, | 289 mock_bluetooth_chooser_view_, |
| 290 OnAdapterEnabledChanged(false /* Bluetooth adapter is turned off */)) | 290 OnAdapterEnabledChanged(false /* Bluetooth adapter is turned off */)) |
| 291 .Times(1); | 291 .Times(1); |
| 292 bluetooth_chooser_controller_.OnAdapterPresenceChanged( | 292 bluetooth_chooser_controller_.OnAdapterPresenceChanged( |
| 293 content::BluetoothChooser::AdapterPresence::POWERED_OFF); | 293 content::BluetoothChooser::AdapterPresence::POWERED_OFF); |
| 294 EXPECT_EQ(0u, bluetooth_chooser_controller_.NumOptions()); | 294 EXPECT_EQ(0u, bluetooth_chooser_controller_.NumOptions()); |
| 295 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_ADAPTER_OFF), | |
| 296 bluetooth_chooser_controller_.GetNoOptionsText()); | |
| 297 EXPECT_EQ(base::string16(), bluetooth_chooser_controller_.GetStatus()); | 295 EXPECT_EQ(base::string16(), bluetooth_chooser_controller_.GetStatus()); |
| 298 } | 296 } |
| 299 | 297 |
| 300 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 298 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 301 BluetoothAdapterTurnedOn) { | 299 BluetoothAdapterTurnedOn) { |
| 302 EXPECT_CALL( | 300 EXPECT_CALL( |
| 303 mock_bluetooth_chooser_view_, | 301 mock_bluetooth_chooser_view_, |
| 304 OnAdapterEnabledChanged(true /* Bluetooth adapter is turned on */)) | 302 OnAdapterEnabledChanged(true /* Bluetooth adapter is turned on */)) |
| 305 .Times(1); | 303 .Times(1); |
| 306 bluetooth_chooser_controller_.OnAdapterPresenceChanged( | 304 bluetooth_chooser_controller_.OnAdapterPresenceChanged( |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); | 362 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); |
| 365 EXPECT_EQ(std::string(), last_device_id_); | 363 EXPECT_EQ(std::string(), last_device_id_); |
| 366 } | 364 } |
| 367 | 365 |
| 368 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 366 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 369 CloseShouldCallEventHandler) { | 367 CloseShouldCallEventHandler) { |
| 370 bluetooth_chooser_controller_.Close(); | 368 bluetooth_chooser_controller_.Close(); |
| 371 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); | 369 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); |
| 372 EXPECT_EQ(std::string(), last_device_id_); | 370 EXPECT_EQ(std::string(), last_device_id_); |
| 373 } | 371 } |
| OLD | NEW |