Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |