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

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

Issue 2561883002: bluetooth: web: Chooser RSSI indicator now based on percentile buckets (Closed)
Patch Set: unittest and 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
« no previous file with comments | « content/browser/bluetooth/bluetooth_device_chooser_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/bluetooth/bluetooth_device_chooser_controller.h" 5 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace content { 8 namespace content {
9 9
10 class BluetoothDeviceChooserControllerTest : public testing::Test {}; 10 class BluetoothDeviceChooserControllerTest : public testing::Test {};
11 11
12 TEST_F(BluetoothDeviceChooserControllerTest, CalculateSignalStrengthLevel) { 12 TEST_F(BluetoothDeviceChooserControllerTest, CalculateSignalStrengthLevel) {
13 EXPECT_EQ( 13 EXPECT_EQ(
14 0, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-128)); 14 0, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-128));
15 EXPECT_EQ( 15 EXPECT_EQ(
16 0, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-100)); 16 0, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-72));
17
17 EXPECT_EQ( 18 EXPECT_EQ(
18 0, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-89)); 19 1, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-71));
19 EXPECT_EQ( 20 EXPECT_EQ(
20 1, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-88)); 21 1, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-64));
22
21 EXPECT_EQ( 23 EXPECT_EQ(
22 1, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-78)); 24 2, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-63));
23 EXPECT_EQ( 25 EXPECT_EQ(
24 2, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-77)); 26 2, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-56));
27
25 EXPECT_EQ( 28 EXPECT_EQ(
26 2, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-67)); 29 3, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-55));
27 EXPECT_EQ( 30 EXPECT_EQ(
28 3, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-66)); 31 3, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-48));
32
29 EXPECT_EQ( 33 EXPECT_EQ(
30 3, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-56)); 34 4, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-47));
31 EXPECT_EQ(
32 4, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(-55));
33 EXPECT_EQ( 35 EXPECT_EQ(
34 4, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(127)); 36 4, BluetoothDeviceChooserController::CalculateSignalStrengthLevel(127));
35 } 37 }
36 38
37 } // namespace content 39 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/bluetooth/bluetooth_device_chooser_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698