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

Side by Side Diff: content/browser/bluetooth/bluetooth_device_chooser_controller_unittest.cc

Issue 2245603003: Add signal strength indicator icon to WebBluetooth chooser on non-Mac desktops (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 4 months 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <limits>
6
7 #include "base/macros.h"
8 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 class BluetoothDeviceChooserControllerTest : public testing::Test {
12 public:
Jeffrey Yasskin 2016/08/20 00:03:29 You should omit all of the contents of this class.
juncai 2016/08/20 01:17:02 Done.
13 BluetoothDeviceChooserControllerTest() {}
14 ~BluetoothDeviceChooserControllerTest() override = default;
15
16 private:
17 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChooserControllerTest);
18 };
19
20 TEST_F(BluetoothDeviceChooserControllerTest, CalculateSignalStrengthLevel) {
21 int low = std::numeric_limits<int8_t>::min();
22 int high = std::numeric_limits<int8_t>::max();
23 for (int rssi = low; rssi <= high; ++rssi) {
Jeffrey Yasskin 2016/08/20 00:03:29 Instead of the exhaustive test, check some concret
juncai 2016/08/20 01:17:02 Done.
24 int level =
25 content::BluetoothDeviceChooserController::CalculateSignalStrengthLevel(
26 static_cast<int8_t>(rssi));
27 EXPECT_LE(0, level);
28 EXPECT_GE(4, level);
29 }
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698