| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, RefreshOptions) { | 345 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, RefreshOptions) { |
| 346 bluetooth_chooser_controller_.RefreshOptions(); | 346 bluetooth_chooser_controller_.RefreshOptions(); |
| 347 EXPECT_EQ(0u, bluetooth_chooser_controller_.NumOptions()); | 347 EXPECT_EQ(0u, bluetooth_chooser_controller_.NumOptions()); |
| 348 EXPECT_EQ(content::BluetoothChooser::Event::RESCAN, last_event_); | 348 EXPECT_EQ(content::BluetoothChooser::Event::RESCAN, last_event_); |
| 349 EXPECT_EQ(std::string(), last_device_id_); | 349 EXPECT_EQ(std::string(), last_device_id_); |
| 350 } | 350 } |
| 351 | 351 |
| 352 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 352 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 353 SelectingOneDeviceShouldCallEventHandler) { | 353 SelectingOneDeviceShouldCallEventHandler) { |
| 354 bluetooth_chooser_controller_.Select(0); | 354 std::vector<size_t> indices{0}; |
| 355 bluetooth_chooser_controller_.Select(indices); |
| 355 EXPECT_EQ(content::BluetoothChooser::Event::SELECTED, last_event_); | 356 EXPECT_EQ(content::BluetoothChooser::Event::SELECTED, last_event_); |
| 356 EXPECT_EQ("id_a", last_device_id_); | 357 EXPECT_EQ("id_a", last_device_id_); |
| 357 } | 358 } |
| 358 | 359 |
| 359 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 360 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 360 CancelShouldCallEventHandler) { | 361 CancelShouldCallEventHandler) { |
| 361 bluetooth_chooser_controller_.Cancel(); | 362 bluetooth_chooser_controller_.Cancel(); |
| 362 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); | 363 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); |
| 363 EXPECT_EQ(std::string(), last_device_id_); | 364 EXPECT_EQ(std::string(), last_device_id_); |
| 364 } | 365 } |
| 365 | 366 |
| 366 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, | 367 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, |
| 367 CloseShouldCallEventHandler) { | 368 CloseShouldCallEventHandler) { |
| 368 bluetooth_chooser_controller_.Close(); | 369 bluetooth_chooser_controller_.Close(); |
| 369 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); | 370 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); |
| 370 EXPECT_EQ(std::string(), last_device_id_); | 371 EXPECT_EQ(std::string(), last_device_id_); |
| 371 } | 372 } |
| OLD | NEW |