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

Side by Side Diff: chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc

Issue 2518933004: Add multiple selection support to chooser on desktops (Closed)
Patch Set: address comments Created 4 years 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 unified diff | Download patch
OLDNEW
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
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;
355 indices.push_back(0);
Reilly Grant (use Gerrit) 2016/11/22 20:55:27 std::vector<size_t> indices{1};
juncai 2016/11/22 23:12:06 Done.
356 bluetooth_chooser_controller_.Select(indices);
355 EXPECT_EQ(content::BluetoothChooser::Event::SELECTED, last_event_); 357 EXPECT_EQ(content::BluetoothChooser::Event::SELECTED, last_event_);
356 EXPECT_EQ("id_a", last_device_id_); 358 EXPECT_EQ("id_a", last_device_id_);
357 } 359 }
358 360
359 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, 361 TEST_F(BluetoothChooserControllerWithDevicesAddedTest,
360 CancelShouldCallEventHandler) { 362 CancelShouldCallEventHandler) {
361 bluetooth_chooser_controller_.Cancel(); 363 bluetooth_chooser_controller_.Cancel();
362 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); 364 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_);
363 EXPECT_EQ(std::string(), last_device_id_); 365 EXPECT_EQ(std::string(), last_device_id_);
364 } 366 }
365 367
366 TEST_F(BluetoothChooserControllerWithDevicesAddedTest, 368 TEST_F(BluetoothChooserControllerWithDevicesAddedTest,
367 CloseShouldCallEventHandler) { 369 CloseShouldCallEventHandler) {
368 bluetooth_chooser_controller_.Close(); 370 bluetooth_chooser_controller_.Close();
369 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_); 371 EXPECT_EQ(content::BluetoothChooser::Event::CANCELLED, last_event_);
370 EXPECT_EQ(std::string(), last_device_id_); 372 EXPECT_EQ(std::string(), last_device_id_);
371 } 373 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698