| Index: net/android/cellular_signal_strength_unittest.cc
|
| diff --git a/net/android/cellular_signal_strength_unittest.cc b/net/android/cellular_signal_strength_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..802bf84bc2e0b93d4241a235a27c4f4f3ba71e3d
|
| --- /dev/null
|
| +++ b/net/android/cellular_signal_strength_unittest.cc
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "net/android/cellular_signal_strength.h"
|
| +
|
| +#include <stddef.h>
|
| +
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace net {
|
| +
|
| +namespace {
|
| +
|
| +// This test should be run manually since the test APK requires
|
| +// ACCESS_COARSE_LOCATION permission, and the device needs to have an active
|
| +// cellular connection.
|
| +TEST(CellularSignalStrengthAndroidTest, DISABLED_RssiTest) {
|
| + int64_t rssi = INT64_MIN;
|
| + EXPECT_TRUE(android::cellular_signal_strength::GetRssiDbm(&rssi));
|
| + // RSSI (in dbM) should typically be between -100 and 0.
|
| + EXPECT_LE(-100, rssi);
|
| + EXPECT_GE(0, rssi);
|
| +}
|
| +
|
| +// This test should be run manually since the test APK requires
|
| +// ACCESS_COARSE_LOCATION permission, and the device needs to have an active
|
| +// cellular connection.
|
| +TEST(CellularSignalStrengthAndroidTest, DISABLED_SignalLevelTest) {
|
| + int64_t signal_level = INT64_MIN;
|
| + EXPECT_TRUE(android::cellular_signal_strength::GetSignalLevel(&signal_level));
|
| + EXPECT_LE(0, signal_level);
|
| + EXPECT_GE(4, signal_level);
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +} // namespace net
|
|
|