| 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 "net/android/cellular_signal_strength.h" |
| 6 |
| 7 #include <stddef.h> |
| 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 |
| 11 namespace net { |
| 12 |
| 13 namespace { |
| 14 |
| 15 // This test should be run manually since the test APK requires |
| 16 // ACCESS_COARSE_LOCATION permission, and the device needs to have an active |
| 17 // cellular connection. |
| 18 TEST(CellularSignalStrengthAndroidTest, DISABLED_RssiTest) { |
| 19 int64_t rssi = INT64_MIN; |
| 20 EXPECT_TRUE(android::cellular_signal_strength::GetRssiDbm(&rssi)); |
| 21 // RSSI (in dbM) should typically be between -100 and 0. |
| 22 EXPECT_LE(-100, rssi); |
| 23 EXPECT_GE(0, rssi); |
| 24 } |
| 25 |
| 26 // This test should be run manually since the test APK requires |
| 27 // ACCESS_COARSE_LOCATION permission, and the device needs to have an active |
| 28 // cellular connection. |
| 29 TEST(CellularSignalStrengthAndroidTest, DISABLED_SignalLevelTest) { |
| 30 int64_t signal_level = INT64_MIN; |
| 31 EXPECT_TRUE(android::cellular_signal_strength::GetSignalLevel(&signal_level)); |
| 32 EXPECT_LE(0, signal_level); |
| 33 EXPECT_GE(4, signal_level); |
| 34 } |
| 35 |
| 36 } // namespace |
| 37 |
| 38 } // namespace net |
| OLD | NEW |