chromium/chrome/browser/ui/views/performance_controls/battery_saver_button_unittest.cc

// 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/ui/views/performance_controls/battery_saver_button.h"

#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/performance_manager/test_support/test_user_performance_tuning_manager_environment.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/performance_controls/performance_controls_metrics.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/test_with_browser_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/testing_browser_process.h"
#include "components/performance_manager/public/features.h"
#include "components/performance_manager/public/user_tuning/prefs.h"
#include "components/prefs/testing_pref_service.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/events/event_utils.h"
#include "ui/views/bubble/bubble_dialog_model_host.h"
#include "ui/views/interaction/element_tracker_views.h"
#include "ui/views/test/button_test_api.h"
#include "ui/views/test/widget_test.h"

class BatterySaverButtonTest : public TestWithBrowserView {};

// Battery Saver is controlled by the OS on ChromeOS
#if !BUILDFLAG(IS_CHROMEOS_ASH)

// Battery saver button should not be shown when the pref state for battery
// saver mode is ON and shown when the pref state is ON
TEST_F(BatterySaverButtonTest, ShouldButtonShowTest) {}

// Battery saver button has the correct tooltip and accessibility text
TEST_F(BatterySaverButtonTest, TooltipAccessibilityTextTest) {}

// Battery saver bubble should be shown when the toolbar button is clicked
// and dismissed when it is clicked again
TEST_F(BatterySaverButtonTest, ShowAndHideBubbleOnButtonPressTest) {}

// Dismiss bubble if expanded when battery saver mode is deactivated
TEST_F(BatterySaverButtonTest, DismissBubbleWhenModeDeactivatedTest) {}

// Check if the element identifier is set correctly by the battery saver
// toolbar button
TEST_F(BatterySaverButtonTest, ElementIdentifierTest) {}

TEST_F(BatterySaverButtonTest, LogMetricsOnDialogDismissTest) {}

TEST_F(BatterySaverButtonTest, LogMetricsOnTurnOffNowTest) {}

#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)