File: bluetooth_device_list_item_view_unittest.cc

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (455 lines) | stat: -rw-r--r-- 20,045 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/system/bluetooth/bluetooth_device_list_item_view.h"

#include <cstdint>
#include <memory>
#include <utility>

#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_id.h"
#include "ash/system/bluetooth/bluetooth_device_list_item_battery_view.h"
#include "ash/system/bluetooth/bluetooth_device_list_item_multiple_battery_view.h"
#include "ash/system/bluetooth/fake_bluetooth_detailed_view.h"
#include "ash/test/ash_test_base.h"
#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chromeos/ash/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h"
#include "chromeos/constants/chromeos_features.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "chromeos/ui/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_unittest_util.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/view_utils.h"
#include "ui/views/widget/widget.h"

namespace ash {

namespace {

using bluetooth_config::mojom::BatteryProperties;
using bluetooth_config::mojom::BatteryPropertiesPtr;
using bluetooth_config::mojom::BluetoothDeviceProperties;
using bluetooth_config::mojom::DeviceBatteryInfo;
using bluetooth_config::mojom::DeviceBatteryInfoPtr;
using bluetooth_config::mojom::DeviceConnectionState;
using bluetooth_config::mojom::DeviceType;
using bluetooth_config::mojom::PairedBluetoothDeviceProperties;
using bluetooth_config::mojom::PairedBluetoothDevicePropertiesPtr;

const char kDeviceId[] = "/device/id";
const std::string kDeviceNickname = "clicky keys";
const std::u16string kDevicePublicName = u"Mechanical Keyboard";
constexpr uint8_t kBatteryPercentage = 27;
constexpr uint8_t kLeftBudBatteryPercentage = 27;
constexpr uint8_t kCaseBatteryPercentage = 54;
constexpr uint8_t kRightBudBatteryPercentage = 81;
constexpr int kTestDeviceIndex = 3;
constexpr int kTestDeviceCount = 5;

PairedBluetoothDevicePropertiesPtr CreatePairedDeviceProperties() {
  PairedBluetoothDevicePropertiesPtr paired_device_properties =
      PairedBluetoothDeviceProperties::New();
  paired_device_properties->device_properties =
      BluetoothDeviceProperties::New();
  paired_device_properties->device_properties->id = kDeviceId;
  paired_device_properties->device_properties->public_name = kDevicePublicName;
  return paired_device_properties;
}

DeviceBatteryInfoPtr CreateDefaultBatteryInfo(uint8_t battery_percentage) {
  DeviceBatteryInfoPtr battery_info = DeviceBatteryInfo::New();
  battery_info->default_properties = BatteryProperties::New();
  battery_info->default_properties->battery_percentage = battery_percentage;
  return battery_info;
}

DeviceBatteryInfoPtr CreateMultipleBatteryInfo(
    std::optional<uint8_t> left_bud_battery_percentage,
    std::optional<uint8_t> case_battery_percentage,
    std::optional<uint8_t> right_bud_battery_percentage) {
  EXPECT_TRUE(left_bud_battery_percentage || case_battery_percentage ||
              right_bud_battery_percentage);
  DeviceBatteryInfoPtr battery_info = DeviceBatteryInfo::New();
  if (left_bud_battery_percentage) {
    battery_info->left_bud_info = BatteryProperties::New();
    battery_info->left_bud_info->battery_percentage =
        left_bud_battery_percentage.value();
  }
  if (case_battery_percentage) {
    battery_info->case_info = BatteryProperties::New();
    battery_info->case_info->battery_percentage =
        case_battery_percentage.value();
  }
  if (right_bud_battery_percentage) {
    battery_info->right_bud_info = BatteryProperties::New();
    battery_info->right_bud_info->battery_percentage =
        right_bud_battery_percentage.value();
  }
  return battery_info;
}

}  // namespace

class BluetoothDeviceListItemViewTest : public AshTestBase {
 public:
  void SetUp() override {
    AshTestBase::SetUp();

    fake_bluetooth_detailed_view_ =
        std::make_unique<FakeBluetoothDetailedView>(/*delegate=*/nullptr);
    std::unique_ptr<BluetoothDeviceListItemView> bluetooth_device_list_item =
        std::make_unique<BluetoothDeviceListItemView>(
            fake_bluetooth_detailed_view_.get());
    bluetooth_device_list_item_ = bluetooth_device_list_item.get();

    bluetooth_device_list_item_->UpdateDeviceProperties(
        /*device_index=*/0, /*device_count=*/0, CreatePairedDeviceProperties());

    widget_ = CreateFramelessTestWidget();
    widget_->SetFullscreen(true);
    widget_->SetContentsView(bluetooth_device_list_item.release());

    base::RunLoop().RunUntilIdle();
  }

  void TearDown() override {
    widget_.reset();

    AshTestBase::TearDown();
  }

  BluetoothDeviceListItemView* bluetooth_device_list_item() {
    return bluetooth_device_list_item_;
  }

  const BluetoothDeviceListItemView* last_clicked_device_list_item() {
    return fake_bluetooth_detailed_view_->last_clicked_device_list_item();
  }

 protected:
  std::unique_ptr<views::Widget> widget_;
  std::unique_ptr<FakeBluetoothDetailedView> fake_bluetooth_detailed_view_;
  raw_ptr<BluetoothDeviceListItemView, DanglingUntriaged>
      bluetooth_device_list_item_;
};

TEST_F(BluetoothDeviceListItemViewTest, HasCorrectLabel) {
  PairedBluetoothDevicePropertiesPtr paired_device_properties =
      CreatePairedDeviceProperties();

  ASSERT_TRUE(bluetooth_device_list_item()->text_label());

  EXPECT_EQ(kDevicePublicName,
            bluetooth_device_list_item()->text_label()->GetText());

  paired_device_properties->nickname = kDeviceNickname;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);

  EXPECT_EQ(base::ASCIIToUTF16(kDeviceNickname),
            bluetooth_device_list_item()->text_label()->GetText());
}

TEST_F(BluetoothDeviceListItemViewTest, HasCorrectSubLabel) {
  PairedBluetoothDevicePropertiesPtr paired_device_properties =
      CreatePairedDeviceProperties();

  EXPECT_FALSE(bluetooth_device_list_item()->sub_text_label());

  paired_device_properties->device_properties->connection_state =
      DeviceConnectionState::kConnecting;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);

  ASSERT_TRUE(bluetooth_device_list_item()->sub_text_label());

  EXPECT_EQ(
      l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_STATUS_CONNECTING),
      bluetooth_device_list_item()->sub_text_label()->GetText());

  paired_device_properties->device_properties->connection_state =
      DeviceConnectionState::kConnected;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);

  // There should not be any content in the sub-row unless battery information
  // is available.
  EXPECT_EQ(0u, bluetooth_device_list_item()->sub_row()->children().size());

  paired_device_properties->device_properties->battery_info =
      CreateDefaultBatteryInfo(kBatteryPercentage);
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);

  EXPECT_EQ(1u, bluetooth_device_list_item()->sub_row()->children().size());
  EXPECT_TRUE(views::IsViewClass<BluetoothDeviceListItemBatteryView>(
      bluetooth_device_list_item()->sub_row()->children().at(0)));

  paired_device_properties->device_properties->battery_info = nullptr;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);

  // The sub-row should be cleared if the battery information is no longer
  // available.
  EXPECT_EQ(0u, bluetooth_device_list_item()->sub_row()->children().size());
}

TEST_F(BluetoothDeviceListItemViewTest, HasExpectedA11yText) {
  const base::flat_map<DeviceType, int> device_type_to_text_id{{
      {DeviceType::kComputer, IDS_BLUETOOTH_A11Y_DEVICE_TYPE_COMPUTER},
      {DeviceType::kGameController,
       IDS_BLUETOOTH_A11Y_DEVICE_TYPE_GAME_CONTROLLER},
      {DeviceType::kHeadset, IDS_BLUETOOTH_A11Y_DEVICE_TYPE_HEADSET},
      {DeviceType::kKeyboard, IDS_BLUETOOTH_A11Y_DEVICE_TYPE_KEYBOARD},
      {DeviceType::kKeyboardMouseCombo,
       IDS_BLUETOOTH_A11Y_DEVICE_TYPE_KEYBOARD_MOUSE_COMBO},
      {DeviceType::kMouse, IDS_BLUETOOTH_A11Y_DEVICE_TYPE_MOUSE},
      {DeviceType::kPhone, IDS_BLUETOOTH_A11Y_DEVICE_TYPE_PHONE},
      {DeviceType::kTablet, IDS_BLUETOOTH_A11Y_DEVICE_TYPE_TABLET},
      {DeviceType::kUnknown, IDS_BLUETOOTH_A11Y_DEVICE_TYPE_UNKNOWN},
      {DeviceType::kVideoCamera, IDS_BLUETOOTH_A11Y_DEVICE_TYPE_VIDEO_CAMERA},
  }};

  const base::flat_map<DeviceConnectionState, int> connection_state_to_text_id{{
      {DeviceConnectionState::kConnected,
       IDS_BLUETOOTH_A11Y_DEVICE_CONNECTION_STATE_CONNECTED},
      {DeviceConnectionState::kConnecting,
       IDS_BLUETOOTH_A11Y_DEVICE_CONNECTION_STATE_CONNECTING},
      {DeviceConnectionState::kNotConnected,
       IDS_BLUETOOTH_A11Y_DEVICE_CONNECTION_STATE_NOT_CONNECTED},
  }};

  // This vector contains all of the possible permutations of battery
  // information a device might have (e.g. no information, single battery, some
  // subset of multiple batteries).
  std::vector<DeviceBatteryInfoPtr> battery_info_permutations;
  battery_info_permutations.push_back(DeviceBatteryInfo::New());
  battery_info_permutations.push_back(
      CreateDefaultBatteryInfo(kBatteryPercentage));
  battery_info_permutations.push_back(
      CreateMultipleBatteryInfo(kLeftBudBatteryPercentage,
                                /*case_battery_percentage=*/std::nullopt,
                                /*right_bud_battery_percentage=*/std::nullopt));
  battery_info_permutations.push_back(CreateMultipleBatteryInfo(
      /*left_bud_battery_percentage=*/std::nullopt, kCaseBatteryPercentage,
      /*right_bud_battery_percentage=*/std::nullopt));
  battery_info_permutations.push_back(CreateMultipleBatteryInfo(
      /*left_bud_battery_percentage=*/std::nullopt,
      /*case_battery_percentage=*/std::nullopt, kRightBudBatteryPercentage));
  battery_info_permutations.push_back(CreateMultipleBatteryInfo(
      kLeftBudBatteryPercentage, kCaseBatteryPercentage,
      /*right_bud_battery_percentage=*/std::nullopt));
  battery_info_permutations.push_back(CreateMultipleBatteryInfo(
      kLeftBudBatteryPercentage, /*case_battery_percentage=*/std::nullopt,
      kRightBudBatteryPercentage));
  battery_info_permutations.push_back(CreateMultipleBatteryInfo(
      /*left_bud_battery_percentage=*/std::nullopt, kCaseBatteryPercentage,
      kRightBudBatteryPercentage));
  battery_info_permutations.push_back(CreateMultipleBatteryInfo(
      kLeftBudBatteryPercentage, kCaseBatteryPercentage,
      kRightBudBatteryPercentage));

  // Include a case where both the default battery properties and the true
  // wireless multiple batteries are available to make sure we prioritize them
  // correctly.
  DeviceBatteryInfoPtr mixed_battery_info = CreateMultipleBatteryInfo(
      kLeftBudBatteryPercentage, kCaseBatteryPercentage,
      kRightBudBatteryPercentage);
  mixed_battery_info->default_properties = BatteryProperties::New();
  mixed_battery_info->default_properties->battery_percentage =
      kBatteryPercentage;
  battery_info_permutations.push_back(std::move(mixed_battery_info));

  PairedBluetoothDevicePropertiesPtr paired_device_properties =
      CreatePairedDeviceProperties();
  paired_device_properties->device_properties->public_name = kDevicePublicName;

  for (const auto& device_type_it : device_type_to_text_id) {
    paired_device_properties->device_properties->device_type =
        device_type_it.first;

    for (const auto& connection_state_it : connection_state_to_text_id) {
      paired_device_properties->device_properties->connection_state =
          connection_state_it.first;

      for (const auto& battery_info_it : battery_info_permutations) {
        paired_device_properties->device_properties->battery_info =
            mojo::Clone(battery_info_it);

        bluetooth_device_list_item()->UpdateDeviceProperties(
            kTestDeviceIndex, kTestDeviceCount, paired_device_properties);

        std::u16string expected_a11y_text = base::StrCat(
            {l10n_util::GetStringFUTF16(
                 IDS_BLUETOOTH_A11Y_DEVICE_NAME,
                 base::NumberToString16(kTestDeviceIndex + 1),
                 base::NumberToString16(kTestDeviceCount), kDevicePublicName),
             u" ", l10n_util::GetStringUTF16(connection_state_it.second), u" ",
             l10n_util::GetStringUTF16(device_type_it.second)});

        auto add_battery_text_if_exists =
            [&expected_a11y_text](
                const BatteryPropertiesPtr& battery_properties, int text_id) {
              if (battery_properties) {
                expected_a11y_text = base::StrCat(
                    {expected_a11y_text, u" ",
                     l10n_util::GetStringFUTF16(
                         text_id,
                         base::NumberToString16(
                             battery_properties->battery_percentage))});
              }
            };

        if (!battery_info_it->left_bud_info && !battery_info_it->case_info &&
            !battery_info_it->right_bud_info) {
          add_battery_text_if_exists(battery_info_it->default_properties,
                                     IDS_BLUETOOTH_A11Y_DEVICE_BATTERY_INFO);
        } else {
          add_battery_text_if_exists(
              battery_info_it->left_bud_info,
              IDS_BLUETOOTH_A11Y_DEVICE_NAMED_BATTERY_INFO_LEFT_BUD);
          add_battery_text_if_exists(
              battery_info_it->case_info,
              IDS_BLUETOOTH_A11Y_DEVICE_NAMED_BATTERY_INFO_CASE);
          add_battery_text_if_exists(
              battery_info_it->right_bud_info,
              IDS_BLUETOOTH_A11Y_DEVICE_NAMED_BATTERY_INFO_RIGHT_BUD);
        }

        EXPECT_EQ(expected_a11y_text, bluetooth_device_list_item()
                                          ->GetViewAccessibility()
                                          .GetCachedName());
      }
    }
  }
}

// We only have access to the ImageSkia instance generated using the vector icon
// for a device, and are thus unable to directly check the vector icon. Instead,
// we generate an image from the ImageSkia instance and an image from the vector
// icon and compare the results.
TEST_F(BluetoothDeviceListItemViewTest, HasCorrectIcon) {
  const base::flat_map<DeviceType, const gfx::VectorIcon*>
      device_type_to_icon_map = {{
          {DeviceType::kComputer, &ash::kSystemMenuComputerIcon},
          {DeviceType::kPhone, &ash::kSystemMenuPhoneIcon},
          {DeviceType::kHeadset, &ash::kSystemMenuHeadsetIcon},
          {DeviceType::kVideoCamera, &ash::kSystemMenuVideocamIcon},
          {DeviceType::kGameController, &ash::kSystemMenuGamepadIcon},
          {DeviceType::kKeyboard, &ash::kSystemMenuKeyboardIcon},
          {DeviceType::kKeyboardMouseCombo, &ash::kSystemMenuKeyboardIcon},
          {DeviceType::kMouse, &ash::kSystemMenuMouseIcon},
          {DeviceType::kTablet, &ash::kSystemMenuTabletIcon},
          {DeviceType::kUnknown, &ash::kSystemMenuBluetoothIcon},
      }};

  const SkColor icon_color =
      bluetooth_device_list_item()->GetColorProvider()->GetColor(
          kColorAshIconColorPrimary);
  for (const auto& it : device_type_to_icon_map) {
    PairedBluetoothDevicePropertiesPtr paired_device_properties =
        CreatePairedDeviceProperties();
    paired_device_properties->device_properties->device_type = it.first;
    bluetooth_device_list_item()->UpdateDeviceProperties(
        /*device_index=*/0, /*device_count=*/0, paired_device_properties);

    const gfx::Image expected_image(
        gfx::CreateVectorIcon(*it.second, icon_color));

    ASSERT_TRUE(views::IsViewClass<views::ImageView>(
        bluetooth_device_list_item()->left_view()));
    const gfx::Image actual_image(static_cast<views::ImageView*>(
                                      bluetooth_device_list_item()->left_view())
                                      ->GetImage());

    EXPECT_TRUE(gfx::test::AreImagesEqual(expected_image, actual_image));
  }
}

TEST_F(BluetoothDeviceListItemViewTest,
       HasEnterpriseIconWhenDeviceIsBlockedByPolicy) {
  PairedBluetoothDevicePropertiesPtr paired_device_properties =
      CreatePairedDeviceProperties();

  paired_device_properties->device_properties->is_blocked_by_policy = false;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);
  EXPECT_FALSE(bluetooth_device_list_item()->right_view());

  paired_device_properties->device_properties->is_blocked_by_policy = true;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);
  ASSERT_TRUE(bluetooth_device_list_item()->right_view());
  EXPECT_TRUE(bluetooth_device_list_item()->right_view()->GetVisible());

  const gfx::Image expected_image(gfx::CreateVectorIcon(
      chromeos::kEnterpriseIcon, /*dip_size=*/20,
      widget_->GetColorProvider()->GetColor(cros_tokens::kCrosSysOnSurface)));

  ASSERT_TRUE(views::IsViewClass<views::ImageView>(
      bluetooth_device_list_item()->right_view()));
  const gfx::Image actual_image(
      static_cast<views::ImageView*>(bluetooth_device_list_item()->right_view())
          ->GetImage());

  EXPECT_TRUE(gfx::test::AreImagesEqual(expected_image, actual_image));

  paired_device_properties->device_properties->is_blocked_by_policy = false;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);
  ASSERT_FALSE(bluetooth_device_list_item()->right_view());
}

TEST_F(BluetoothDeviceListItemViewTest, NotifiesListenerWhenClicked) {
  EXPECT_FALSE(last_clicked_device_list_item());
  LeftClickOn(bluetooth_device_list_item());
  EXPECT_EQ(last_clicked_device_list_item(), bluetooth_device_list_item());
}

TEST_F(BluetoothDeviceListItemViewTest, MultipleBatteries) {
  PairedBluetoothDevicePropertiesPtr paired_device_properties =
      CreatePairedDeviceProperties();
  paired_device_properties->device_properties->connection_state =
      DeviceConnectionState::kConnected;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);

  // There should not be any content in the sub-row unless battery information
  // is available.
  EXPECT_EQ(0u, bluetooth_device_list_item()->sub_row()->children().size());

  paired_device_properties->device_properties->battery_info =
      CreateMultipleBatteryInfo(kLeftBudBatteryPercentage,
                                kCaseBatteryPercentage,
                                kRightBudBatteryPercentage);
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);

  EXPECT_EQ(1u, bluetooth_device_list_item()->sub_row()->children().size());
  EXPECT_TRUE(views::IsViewClass<BluetoothDeviceListItemMultipleBatteryView>(
      bluetooth_device_list_item()->sub_row()->children().at(0)));

  paired_device_properties->device_properties->battery_info = nullptr;
  bluetooth_device_list_item()->UpdateDeviceProperties(
      /*device_index=*/0, /*device_count=*/0, paired_device_properties);

  // The sub-row should be cleared if the battery information is no longer
  // available.
  EXPECT_EQ(0u, bluetooth_device_list_item()->sub_row()->children().size());
}

}  // namespace ash