mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Remove GetOsPermissionStatus from WifiAdapter
PiperOrigin-RevId: 685866926
This commit is contained in:
committed by
Copybara-Service
parent
1198b63e4f
commit
5cd8159cef
@@ -35,7 +35,6 @@ class MockWifiAdapter : public nearby::sharing::api::WifiAdapter {
|
||||
|
||||
MOCK_METHOD(bool, IsPresent, (), (const, override));
|
||||
MOCK_METHOD(bool, IsPowered, (), (const, override));
|
||||
MOCK_METHOD(PermissionStatus, GetOsPermissionStatus, (), (const, override));
|
||||
MOCK_METHOD(void, SetPowered,
|
||||
(bool powered, std::function<void()> success_callback,
|
||||
std::function<void()> error_callback),
|
||||
|
||||
@@ -59,9 +59,6 @@ class WifiAdapter {
|
||||
// Indicates whether the adapter radio is powered.
|
||||
virtual bool IsPowered() const = 0;
|
||||
|
||||
// Returns the status of the browser's Wi-Fi permission status.
|
||||
virtual PermissionStatus GetOsPermissionStatus() const = 0;
|
||||
|
||||
// Requests a change to the adapter radio power. Setting `powered` to true
|
||||
// will turn on the radio and false will turn it off. On success,
|
||||
// `success_callback` will be called. On failure, `error_callback` will be
|
||||
|
||||
@@ -46,11 +46,6 @@ class FakeWifiAdapter : public sharing::api::WifiAdapter {
|
||||
return is_powered_;
|
||||
}
|
||||
|
||||
sharing::api::WifiAdapter::PermissionStatus GetOsPermissionStatus()
|
||||
const override {
|
||||
return sharing::api::WifiAdapter::PermissionStatus::kAllowed;
|
||||
}
|
||||
|
||||
void SetPowered(bool powered, std::function<void()> success_callback,
|
||||
std::function<void()> error_callback) override {
|
||||
success_callback();
|
||||
|
||||
@@ -34,12 +34,6 @@ TEST(FakeWifiAdapter, IsPoweredReturnsTrueByDefault) {
|
||||
EXPECT_TRUE(fake_wifi_adapter.IsPowered());
|
||||
}
|
||||
|
||||
TEST(FakeWifiAdapter, GetOSPermissionStatusReturnsAllowedByDefault) {
|
||||
FakeWifiAdapter fake_wifi_adapter;
|
||||
EXPECT_EQ(fake_wifi_adapter.GetOsPermissionStatus(),
|
||||
sharing::api::WifiAdapter::PermissionStatus::kAllowed);
|
||||
}
|
||||
|
||||
TEST(FakeWifiAdapter, SetPoweredRunsSuccessCallback) {
|
||||
bool powered_on;
|
||||
std::function<void()> success_callback = [&powered_on]() {
|
||||
|
||||
Reference in New Issue
Block a user