Commit f7092538 authored by Sophie Chang's avatar Sophie Chang Committed by Chromium LUCI CQ

Reland "Reenable PredictionManager and HintsFetcher browser tests that were...

Reland "Reenable PredictionManager and HintsFetcher browser tests that were disabled on desktop platforms"

This is a reland of 3bd04812

No changes since this one was reverted incorrectly

Original change's description:
> Reenable PredictionManager and HintsFetcher browser tests that were
> disabled on desktop platforms
>
> Change-Id: I173ac1025760f908042e64c7c8839fb90e41fc78
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626918
> Reviewed-by: Michael Crouse <mcrouse@chromium.org>
> Commit-Queue: Sophie Chang <sophiechang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#843180}

Change-Id: I2bc3449abe44516f018c828c0d91a51101186439
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625959
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Commit-Queue: Michael Crouse <mcrouse@chromium.org>
Auto-Submit: Sophie Chang <sophiechang@chromium.org>
Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843314}
parent 9ce071e2
......@@ -549,22 +549,13 @@ class HintsFetcherBrowserTest : public HintsFetcherDisabledBrowserTest {
DISALLOW_COPY_AND_ASSIGN(HintsFetcherBrowserTest);
};
// Issues with multiple profiles likely cause the site engagement service-based
// tests to flake.
#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
#endif
// This test creates new browser with no profile and loads a random page with
// the feature flags for OptimizationHintsFetching. We confirm that the
// TopHostProvider is called and does not crash by checking UMA
// histograms for the total number of TopEngagementSites and
// the total number of sites returned controlled by the experiments flag
// |max_oneplatform_update_hosts|.
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherEnabled)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherEnabled) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host.
......@@ -605,8 +596,7 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherDisabledBrowserTest, HintsFetcherDisabled) {
// is called to provide a list of hosts to HintsFetcher only returns hosts with
// a HTTPS scheme. We verify this with the UMA histogram logged when the
// GetHintsRequest is made to the remote Optimization Guide Service.
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(TopHostProviderHTTPSOnly)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, TopHostProviderHTTPSOnly) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
// Adds two HTTP and two HTTPS sites into the Site Engagement Service.
......@@ -632,9 +622,8 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
EXPECT_EQ(0u, GetTopHostBlacklistSize());
}
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherFetchedHintsLoaded)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherFetchedHintsLoaded) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
GURL url = https_url();
......@@ -667,9 +656,8 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintCache.HintType.Loaded", 0);
}
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherWithResponsesSuccessful)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherWithResponsesSuccessful) {
SetResponseType(HintsFetcherRemoteResponseType::kSuccessful);
const base::HistogramTester* histogram_tester = GetHistogramTester();
......@@ -699,9 +687,8 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 1, 1);
}
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherWithResponsesUnsuccessful)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherWithResponsesUnsuccessful) {
SetResponseType(HintsFetcherRemoteResponseType::kUnsuccessful);
const base::HistogramTester* histogram_tester = GetHistogramTester();
......@@ -730,9 +717,8 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 0);
}
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherWithResponsesMalformed)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherWithResponsesMalformed) {
SetResponseType(HintsFetcherRemoteResponseType::kMalformed);
const base::HistogramTester* histogram_tester = GetHistogramTester();
......@@ -763,10 +749,8 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 0);
}
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(
HintsFetcherWithResponsesUnsuccessfulAtNavigationTime)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherWithResponsesUnsuccessfulAtNavigationTime) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
SetResponseType(HintsFetcherRemoteResponseType::kUnsuccessful);
......@@ -787,8 +771,7 @@ IN_PROC_BROWSER_TEST_F(
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(
HintsFetcherWithResponsesHungShouldRecordWhenActiveRequestCanceled)) {
HintsFetcherWithResponsesHungShouldRecordWhenActiveRequestCanceled) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
SetResponseType(HintsFetcherRemoteResponseType::kHung);
......@@ -809,9 +792,7 @@ IN_PROC_BROWSER_TEST_F(
1, 1);
}
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherClearFetchedHints)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherClearFetchedHints) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
GURL url = https_url();
......@@ -858,8 +839,7 @@ IN_PROC_BROWSER_TEST_F(
1);
}
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherOverrideTimer)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherOverrideTimer) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
GURL url = https_url();
base::CommandLine::ForCurrentProcess()->RemoveSwitch(
......@@ -905,9 +885,7 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
"OptimizationGuide.HintCache.HintType.Loaded", 0);
}
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherNetworkOffline)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherNetworkOffline) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
GURL url = https_url();
base::CommandLine::ForCurrentProcess()->RemoveSwitch(
......@@ -936,8 +914,7 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintsFetcher.GetHintsRequest.HostCount", 0);
}
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherFetches)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherFetches) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host.
......@@ -966,9 +943,8 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
}
// Test that the hints are fetched at the time of the navigation.
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcher_NavigationFetch_ECT)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcher_NavigationFetch_ECT) {
{
base::HistogramTester histogram_tester;
......@@ -1195,8 +1171,7 @@ IN_PROC_BROWSER_TEST_F(
// Test that the hints are fetched at the time of the navigation.
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(
HintsFetcher_NavigationFetch_URLKeyedNotRefetched)) {
HintsFetcher_NavigationFetch_URLKeyedNotRefetched) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host.
......@@ -1302,8 +1277,7 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
// Test that the hints are fetched at the time of the navigation.
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(
HintsFetcher_NavigationFetch_FetchWithNewlyRegisteredOptType)) {
HintsFetcher_NavigationFetch_FetchWithNewlyRegisteredOptType) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host.
......@@ -1396,8 +1370,7 @@ IN_PROC_BROWSER_TEST_F(
// Test that the hints are fetched at the time of the navigation.
IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(
HintsFetcher_NavigationFetch_CacheNotClearedOnLaunchedOptTypes)) {
HintsFetcher_NavigationFetch_CacheNotClearedOnLaunchedOptTypes) {
const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host.
......@@ -1572,9 +1545,8 @@ class HintsFetcherSearchPageBrowserTest : public HintsFetcherBrowserTest {
}
};
IN_PROC_BROWSER_TEST_F(
HintsFetcherSearchPageBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcher_SRP_Slow_Connection)) {
IN_PROC_BROWSER_TEST_F(HintsFetcherSearchPageBrowserTest,
HintsFetcher_SRP_Slow_Connection) {
g_browser_process->network_quality_tracker()
->ReportEffectiveConnectionTypeForTesting(
net::EFFECTIVE_CONNECTION_TYPE_2G);
......
......@@ -608,13 +608,6 @@ class PredictionManagerTest : public ProtoDatabaseProviderTestBase {
std::unique_ptr<content::TestWebContentsFactory> web_contents_factory_;
};
// No support for Mac, Windows or ChromeOS.
#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
#endif
TEST_F(PredictionManagerTest, RemoteFetchingDisabled) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(
......@@ -822,8 +815,7 @@ TEST_F(PredictionManagerTest,
}
TEST_F(PredictionManagerTest,
DISABLE_ON_WIN_MAC_CHROMEOS(
NoPredictionModelForRegisteredOptimizationTarget)) {
NoPredictionModelForRegisteredOptimizationTarget) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(features::kRemoteOptimizationGuideFetching);
......@@ -1427,8 +1419,7 @@ TEST_F(PredictionManagerTest,
}
TEST_F(PredictionManagerTest,
DISABLE_ON_WIN_MAC_CHROMEOS(
ShouldTargetNavigationStoreUnavailableModelUnknown)) {
ShouldTargetNavigationStoreUnavailableModelUnknown) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(features::kRemoteOptimizationGuideFetching);
......@@ -1570,9 +1561,7 @@ TEST_F(PredictionManagerTest, UpdateModelForRegisteredTargetButNowFile) {
proto::OPTIMIZATION_TARGET_PAINFUL_PAGE_LOAD, {}));
}
TEST_F(
PredictionManagerTest,
DISABLE_ON_WIN_MAC_CHROMEOS(UpdateModelWithUnsupportedOptimizationTarget)) {
TEST_F(PredictionManagerTest, UpdateModelWithUnsupportedOptimizationTarget) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(features::kRemoteOptimizationGuideFetching);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment