#include "chrome/browser/ui/toolbar/app_menu_icon_controller.h"
#include "base/time/default_clock.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/upgrade_detector/upgrade_detector.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_WIN)
#include "chrome/install_static/install_modes.h"
#include "chrome/install_static/test/scoped_install_details.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#include "ash/constants/ash_switches.h"
#include "base/command_line.h"
#include "base/test/scoped_command_line.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/ash/crosapi/browser_util.h"
#include "chromeos/ash/components/standalone_browser/migrator_util.h"
#include "chromeos/ash/components/standalone_browser/standalone_browser_features.h"
#include "components/prefs/testing_pref_service.h"
#include "components/user_manager/fake_user_manager.h"
#include "components/user_manager/scoped_user_manager.h"
#include "components/user_manager/user_manager.h"
#endif
namespace {
class MockAppMenuIconControllerDelegate
: public AppMenuIconController::Delegate { … };
class FakeUpgradeDetector : public UpgradeDetector { … };
base::Time FakeUpgradeDetector::GetAnnoyanceLevelDeadline(
UpgradeNotificationAnnoyanceLevel level) { … }
}
bool operator==(const AppMenuIconController::TypeAndSeverity& a,
const AppMenuIconController::TypeAndSeverity& b) { … }
class AppMenuIconControllerTest : public ::testing::TestWithParam<int> { … };
TEST_P(AppMenuIconControllerTest, UpgradeNotification) { … }
#if BUILDFLAG(IS_WIN)
INSTANTIATE_TEST_SUITE_P(
All,
AppMenuIconControllerTest,
::testing::Range(0, static_cast<int>(install_static::NUM_INSTALL_MODES)));
#else
INSTANTIATE_TEST_SUITE_P(…);
#endif
#if !BUILDFLAG(IS_CHROMEOS)
class AppMenuControllerDefaultPromptTest : public BrowserWithTestWindowTest { … };
TEST_F(AppMenuControllerDefaultPromptTest, SetsDefaultPromptTypeAndSeverity) { … }
#endif