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

Side by Side Diff: net/android/cellular_signal_strength_unittest.cc

Issue 1879743002: Expose cellular signal strength on Android to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 8 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 "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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698