blob: ecc94fe982d959459b641c82da42c787f8329d4c [file] [log] [blame]
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/battery/battery_saver.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
class BatterySaverUnitTest : public ::testing::Test {
public:
BatterySaverUnitTest() = default;
~BatterySaverUnitTest() override = default;
void TearDown() override { battery::ResetIsBatterySaverEnabledForTesting(); }
};
TEST_F(BatterySaverUnitTest, BatterSaverModeCheck) {
battery::OverrideIsBatterySaverEnabledForTesting(true);
EXPECT_TRUE(battery::IsBatterySaverEnabled());
battery::OverrideIsBatterySaverEnabledForTesting(false);
EXPECT_FALSE(battery::IsBatterySaverEnabled());
}
} // namespace