#include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
#include <memory>
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/flags_ui/pref_service_flags_storage.h"
#include "components/prefs/testing_pref_service.h"
#include "components/variations/variations_switches.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/screen.h"
#include "ui/display/test/test_screen.h"
#include "ui/gfx/geometry/size.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/dbus/u2f/u2f_client.h"
#endif
namespace {
const char kSupportsHDRHistogramName[] = …;
constexpr char kEnableBenchmarkingPrefId[] = …;
constexpr char kFlagMultiValue[] = …;
class ChromeBrowserMainExtraPartsMetricsFake
: public ChromeBrowserMainExtraPartsMetrics { … };
}
class ChromeBrowserMainExtraPartsMetricsTest : public testing::Test { … };
ChromeBrowserMainExtraPartsMetricsTest::
ChromeBrowserMainExtraPartsMetricsTest() { … }
ChromeBrowserMainExtraPartsMetricsTest::
~ChromeBrowserMainExtraPartsMetricsTest() { … }
TEST_F(ChromeBrowserMainExtraPartsMetricsTest,
VerifySupportsHDRIsRecordedAfterPostBrowserStart) { … }
TEST_F(ChromeBrowserMainExtraPartsMetricsTest,
EnableBenchmarkingCountdownNoFlag) { … }
TEST_F(ChromeBrowserMainExtraPartsMetricsTest,
EnableBenchmarkingCountdownFromNoStorage) { … }
TEST_F(ChromeBrowserMainExtraPartsMetricsTest,
EnableBenchmarkingCountdownFromStorage2) { … }
TEST_F(ChromeBrowserMainExtraPartsMetricsTest,
EnableBenchmarkingCountdownFromStorage1) { … }
#if BUILDFLAG(IS_ANDROID)
TEST_F(ChromeBrowserMainExtraPartsMetricsTest,
IsBundleForMixedDeviceAccordingToVersionCode) {
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505130"));
EXPECT_TRUE(IsBundleForMixedDeviceAccordingToVersionCode("584505131"));
EXPECT_TRUE(IsBundleForMixedDeviceAccordingToVersionCode("584505132"));
EXPECT_TRUE(IsBundleForMixedDeviceAccordingToVersionCode("584505133"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505134"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505135"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505136"));
EXPECT_TRUE(IsBundleForMixedDeviceAccordingToVersionCode("584505137"));
EXPECT_TRUE(IsBundleForMixedDeviceAccordingToVersionCode("584505138"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505139"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505121"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505122"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505123"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505101"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("584505141"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode(""));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("0"));
EXPECT_FALSE(IsBundleForMixedDeviceAccordingToVersionCode("5845-051-3-1"));
}
#endif