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

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/+/2626918Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843180}
parent 04b13325
...@@ -549,22 +549,13 @@ class HintsFetcherBrowserTest : public HintsFetcherDisabledBrowserTest { ...@@ -549,22 +549,13 @@ class HintsFetcherBrowserTest : public HintsFetcherDisabledBrowserTest {
DISALLOW_COPY_AND_ASSIGN(HintsFetcherBrowserTest); 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 // This test creates new browser with no profile and loads a random page with
// the feature flags for OptimizationHintsFetching. We confirm that the // the feature flags for OptimizationHintsFetching. We confirm that the
// TopHostProvider is called and does not crash by checking UMA // TopHostProvider is called and does not crash by checking UMA
// histograms for the total number of TopEngagementSites and // histograms for the total number of TopEngagementSites and
// the total number of sites returned controlled by the experiments flag // the total number of sites returned controlled by the experiments flag
// |max_oneplatform_update_hosts|. // |max_oneplatform_update_hosts|.
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherEnabled) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherEnabled)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host. // Whitelist NoScript for https_url()'s' host.
...@@ -605,8 +596,7 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherDisabledBrowserTest, HintsFetcherDisabled) { ...@@ -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 // 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 // a HTTPS scheme. We verify this with the UMA histogram logged when the
// GetHintsRequest is made to the remote Optimization Guide Service. // GetHintsRequest is made to the remote Optimization Guide Service.
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, TopHostProviderHTTPSOnly) {
DISABLE_ON_WIN_MAC_CHROMEOS(TopHostProviderHTTPSOnly)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
// Adds two HTTP and two HTTPS sites into the Site Engagement Service. // Adds two HTTP and two HTTPS sites into the Site Engagement Service.
...@@ -632,9 +622,8 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, ...@@ -632,9 +622,8 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
EXPECT_EQ(0u, GetTopHostBlacklistSize()); EXPECT_EQ(0u, GetTopHostBlacklistSize());
} }
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherBrowserTest, HintsFetcherFetchedHintsLoaded) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherFetchedHintsLoaded)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
GURL url = https_url(); GURL url = https_url();
...@@ -667,9 +656,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -667,9 +656,8 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintCache.HintType.Loaded", 0); "OptimizationGuide.HintCache.HintType.Loaded", 0);
} }
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherBrowserTest, HintsFetcherWithResponsesSuccessful) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherWithResponsesSuccessful)) {
SetResponseType(HintsFetcherRemoteResponseType::kSuccessful); SetResponseType(HintsFetcherRemoteResponseType::kSuccessful);
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
...@@ -699,9 +687,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -699,9 +687,8 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 1, 1); "OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 1, 1);
} }
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherBrowserTest, HintsFetcherWithResponsesUnsuccessful) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherWithResponsesUnsuccessful)) {
SetResponseType(HintsFetcherRemoteResponseType::kUnsuccessful); SetResponseType(HintsFetcherRemoteResponseType::kUnsuccessful);
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
...@@ -730,9 +717,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -730,9 +717,8 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 0); "OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 0);
} }
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherBrowserTest, HintsFetcherWithResponsesMalformed) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherWithResponsesMalformed)) {
SetResponseType(HintsFetcherRemoteResponseType::kMalformed); SetResponseType(HintsFetcherRemoteResponseType::kMalformed);
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
...@@ -763,10 +749,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -763,10 +749,8 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 0); "OptimizationGuide.HintsFetcher.GetHintsRequest.HintCount", 0);
} }
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherBrowserTest, HintsFetcherWithResponsesUnsuccessfulAtNavigationTime) {
DISABLE_ON_WIN_MAC_CHROMEOS(
HintsFetcherWithResponsesUnsuccessfulAtNavigationTime)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
SetResponseType(HintsFetcherRemoteResponseType::kUnsuccessful); SetResponseType(HintsFetcherRemoteResponseType::kUnsuccessful);
...@@ -787,8 +771,7 @@ IN_PROC_BROWSER_TEST_F( ...@@ -787,8 +771,7 @@ IN_PROC_BROWSER_TEST_F(
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest, HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS( HintsFetcherWithResponsesHungShouldRecordWhenActiveRequestCanceled) {
HintsFetcherWithResponsesHungShouldRecordWhenActiveRequestCanceled)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
SetResponseType(HintsFetcherRemoteResponseType::kHung); SetResponseType(HintsFetcherRemoteResponseType::kHung);
...@@ -809,9 +792,7 @@ IN_PROC_BROWSER_TEST_F( ...@@ -809,9 +792,7 @@ IN_PROC_BROWSER_TEST_F(
1, 1); 1, 1);
} }
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherClearFetchedHints) {
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherClearFetchedHints)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
GURL url = https_url(); GURL url = https_url();
...@@ -858,8 +839,7 @@ IN_PROC_BROWSER_TEST_F( ...@@ -858,8 +839,7 @@ IN_PROC_BROWSER_TEST_F(
1); 1);
} }
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherOverrideTimer) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherOverrideTimer)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
GURL url = https_url(); GURL url = https_url();
base::CommandLine::ForCurrentProcess()->RemoveSwitch( base::CommandLine::ForCurrentProcess()->RemoveSwitch(
...@@ -905,9 +885,7 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, ...@@ -905,9 +885,7 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
"OptimizationGuide.HintCache.HintType.Loaded", 0); "OptimizationGuide.HintCache.HintType.Loaded", 0);
} }
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherNetworkOffline) {
HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherNetworkOffline)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
GURL url = https_url(); GURL url = https_url();
base::CommandLine::ForCurrentProcess()->RemoveSwitch( base::CommandLine::ForCurrentProcess()->RemoveSwitch(
...@@ -936,8 +914,7 @@ IN_PROC_BROWSER_TEST_F( ...@@ -936,8 +914,7 @@ IN_PROC_BROWSER_TEST_F(
"OptimizationGuide.HintsFetcher.GetHintsRequest.HostCount", 0); "OptimizationGuide.HintsFetcher.GetHintsRequest.HostCount", 0);
} }
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, HintsFetcherFetches) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcherFetches)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host. // Whitelist NoScript for https_url()'s' host.
...@@ -966,9 +943,8 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, ...@@ -966,9 +943,8 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
} }
// Test that the hints are fetched at the time of the navigation. // Test that the hints are fetched at the time of the navigation.
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
HintsFetcherBrowserTest, HintsFetcher_NavigationFetch_ECT) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcher_NavigationFetch_ECT)) {
{ {
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
...@@ -1195,8 +1171,7 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1195,8 +1171,7 @@ IN_PROC_BROWSER_TEST_F(
// Test that the hints are fetched at the time of the navigation. // Test that the hints are fetched at the time of the navigation.
IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS( HintsFetcher_NavigationFetch_URLKeyedNotRefetched) {
HintsFetcher_NavigationFetch_URLKeyedNotRefetched)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host. // Whitelist NoScript for https_url()'s' host.
...@@ -1302,8 +1277,7 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, ...@@ -1302,8 +1277,7 @@ IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest,
// Test that the hints are fetched at the time of the navigation. // Test that the hints are fetched at the time of the navigation.
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest, HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS( HintsFetcher_NavigationFetch_FetchWithNewlyRegisteredOptType) {
HintsFetcher_NavigationFetch_FetchWithNewlyRegisteredOptType)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host. // Whitelist NoScript for https_url()'s' host.
...@@ -1396,8 +1370,7 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1396,8 +1370,7 @@ IN_PROC_BROWSER_TEST_F(
// Test that the hints are fetched at the time of the navigation. // Test that the hints are fetched at the time of the navigation.
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(
HintsFetcherBrowserTest, HintsFetcherBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS( HintsFetcher_NavigationFetch_CacheNotClearedOnLaunchedOptTypes) {
HintsFetcher_NavigationFetch_CacheNotClearedOnLaunchedOptTypes)) {
const base::HistogramTester* histogram_tester = GetHistogramTester(); const base::HistogramTester* histogram_tester = GetHistogramTester();
// Whitelist NoScript for https_url()'s' host. // Whitelist NoScript for https_url()'s' host.
...@@ -1572,9 +1545,8 @@ class HintsFetcherSearchPageBrowserTest : public HintsFetcherBrowserTest { ...@@ -1572,9 +1545,8 @@ class HintsFetcherSearchPageBrowserTest : public HintsFetcherBrowserTest {
} }
}; };
IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(HintsFetcherSearchPageBrowserTest,
HintsFetcherSearchPageBrowserTest, HintsFetcher_SRP_Slow_Connection) {
DISABLE_ON_WIN_MAC_CHROMEOS(HintsFetcher_SRP_Slow_Connection)) {
g_browser_process->network_quality_tracker() g_browser_process->network_quality_tracker()
->ReportEffectiveConnectionTypeForTesting( ->ReportEffectiveConnectionTypeForTesting(
net::EFFECTIVE_CONNECTION_TYPE_2G); net::EFFECTIVE_CONNECTION_TYPE_2G);
......
...@@ -608,13 +608,6 @@ class PredictionManagerTest : public ProtoDatabaseProviderTestBase { ...@@ -608,13 +608,6 @@ class PredictionManagerTest : public ProtoDatabaseProviderTestBase {
std::unique_ptr<content::TestWebContentsFactory> web_contents_factory_; 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) { TEST_F(PredictionManagerTest, RemoteFetchingDisabled) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature( feature_list.InitAndDisableFeature(
...@@ -822,8 +815,7 @@ TEST_F(PredictionManagerTest, ...@@ -822,8 +815,7 @@ TEST_F(PredictionManagerTest,
} }
TEST_F(PredictionManagerTest, TEST_F(PredictionManagerTest,
DISABLE_ON_WIN_MAC_CHROMEOS( NoPredictionModelForRegisteredOptimizationTarget) {
NoPredictionModelForRegisteredOptimizationTarget)) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(features::kRemoteOptimizationGuideFetching); feature_list.InitAndEnableFeature(features::kRemoteOptimizationGuideFetching);
...@@ -1427,8 +1419,7 @@ TEST_F(PredictionManagerTest, ...@@ -1427,8 +1419,7 @@ TEST_F(PredictionManagerTest,
} }
TEST_F(PredictionManagerTest, TEST_F(PredictionManagerTest,
DISABLE_ON_WIN_MAC_CHROMEOS( ShouldTargetNavigationStoreUnavailableModelUnknown) {
ShouldTargetNavigationStoreUnavailableModelUnknown)) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(features::kRemoteOptimizationGuideFetching); feature_list.InitAndEnableFeature(features::kRemoteOptimizationGuideFetching);
...@@ -1570,9 +1561,7 @@ TEST_F(PredictionManagerTest, UpdateModelForRegisteredTargetButNowFile) { ...@@ -1570,9 +1561,7 @@ TEST_F(PredictionManagerTest, UpdateModelForRegisteredTargetButNowFile) {
proto::OPTIMIZATION_TARGET_PAINFUL_PAGE_LOAD, {})); proto::OPTIMIZATION_TARGET_PAINFUL_PAGE_LOAD, {}));
} }
TEST_F( TEST_F(PredictionManagerTest, UpdateModelWithUnsupportedOptimizationTarget) {
PredictionManagerTest,
DISABLE_ON_WIN_MAC_CHROMEOS(UpdateModelWithUnsupportedOptimizationTarget)) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(features::kRemoteOptimizationGuideFetching); 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