xref: /aosp_15_r20/external/cronet/base/android/radio_utils_unittest.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2022 The Chromium Authors
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 "base/android/radio_utils.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7 
8 namespace base {
9 
10 namespace android {
11 
TEST(RadioUtilsTest,ConnectionType)12 TEST(RadioUtilsTest, ConnectionType) {
13   RadioUtils::OverrideForTesting radio_utils_test;
14 
15   radio_utils_test.SetConnectionTypeForTesting(RadioConnectionType::kUnknown);
16   EXPECT_EQ(RadioConnectionType::kUnknown, RadioUtils::GetConnectionType());
17 
18   radio_utils_test.SetConnectionTypeForTesting(RadioConnectionType::kCell);
19   EXPECT_EQ(RadioConnectionType::kCell, RadioUtils::GetConnectionType());
20 
21   radio_utils_test.SetConnectionTypeForTesting(RadioConnectionType::kWifi);
22   EXPECT_EQ(RadioConnectionType::kWifi, RadioUtils::GetConnectionType());
23 }
24 
25 }  // namespace android
26 }  // namespace base