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

Revert "Re-enable PredictionManager browser tests on Win/Mac/CrOS"

This reverts commit 1a291df2.

Reason for revert: Some issues with Windows

Original change's description:
> Re-enable PredictionManager browser tests on Win/Mac/CrOS
>
> And fix init issue on ChromeOS for sign in profiles
>
> Change-Id: I26b87d58f2eae2afecf67685690312a8aed70c60
> Bug: 1146151
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625157
> Reviewed-by: Michael Crouse <mcrouse@chromium.org>
> Commit-Queue: Sophie Chang <sophiechang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#843176}

TBR=sophiechang@chromium.org,mcrouse@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I4cb2f29850ebfe025ff9d3d016e2c1c31f4471de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1146151
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626981Reviewed-by: default avatarSophie Chang <sophiechang@chromium.org>
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843259}
parent 3fbdf344
......@@ -4,7 +4,6 @@
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h"
#include "build/build_config.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
......@@ -12,10 +11,6 @@
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "content/public/browser/browser_context.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#endif
// static
OptimizationGuideKeyedService*
OptimizationGuideKeyedServiceFactory::GetForProfile(Profile* profile) {
......@@ -43,18 +38,6 @@ OptimizationGuideKeyedServiceFactory::~OptimizationGuideKeyedServiceFactory() =
KeyedService* OptimizationGuideKeyedServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Do not build the OptimizationGuideKeyedService if it's a sign-in profile
// since it basically is an ephemeral profile anyway and we cannot provide
// hints or models to it anyway. Additionally, sign in profiles do not go
// through the standard profile initialization flow, so a lot of things that
// are required are not available when the browser context for the signin
// profile is created.
Profile* profile = Profile::FromBrowserContext(context);
if (chromeos::ProfileHelper::IsSigninProfile(profile))
return nullptr;
#endif
return new OptimizationGuideKeyedService(context);
}
......
......@@ -456,8 +456,15 @@ class PredictionManagerBrowserTest : public PredictionManagerBrowserTestBase {
}
};
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
FCPReachedSessionStatisticsUpdated) {
#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
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(FCPReachedSessionStatisticsUpdated)) {
RegisterWithKeyedService();
auto waiter = CreatePageLoadMetricsTestWaiter();
waiter->AddPageExpectation(
......@@ -471,8 +478,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
EXPECT_EQ(1u, session_fcp->GetNumberOfSamples());
}
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
NoFCPSessionStatisticsUnchanged) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(NoFCPSessionStatisticsUnchanged)) {
RegisterWithKeyedService();
auto waiter = CreatePageLoadMetricsTestWaiter();
waiter->AddPageExpectation(
......@@ -493,8 +501,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
EXPECT_EQ(current_mean, session_fcp->GetMean());
}
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
ModelsAndFeaturesStoreInitialized) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(ModelsAndFeaturesStoreInitialized)) {
base::HistogramTester histogram_tester;
content::NetworkConnectionChangeSimulator().SetConnectionType(
network::mojom::ConnectionType::CONNECTION_2G);
......@@ -517,8 +526,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
"OptimizationGuide.PredictionModelLoadedVersion.PainfulPageLoad", 2, 1);
}
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
OnlyHostModelFeaturesInGetModelsResponse) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(OnlyHostModelFeaturesInGetModelsResponse)) {
base::HistogramTester histogram_tester;
SetResponseType(PredictionModelsFetcherRemoteResponseType::
......@@ -537,8 +547,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
"OptimizationGuide.PredictionModelLoadedVersion.PainfulPageLoad", 0);
}
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
OnlyPredictionModelsInGetModelsResponse) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(OnlyPredictionModelsInGetModelsResponse)) {
base::HistogramTester histogram_tester;
SetResponseType(PredictionModelsFetcherRemoteResponseType::
......@@ -563,8 +574,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
"OptimizationGuide.PredictionModelLoadedVersion.PainfulPageLoad", 2, 1);
}
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
PredictionModelFetchFailed) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(PredictionModelFetchFailed)) {
SetResponseType(PredictionModelsFetcherRemoteResponseType::kUnsuccessful);
base::HistogramTester histogram_tester;
......@@ -590,8 +602,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
"OptimizationGuide.PredictionModelLoadedVersion.PainfulPageLoad", 0);
}
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
HostModelFeaturesClearedOnHistoryClear) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(HostModelFeaturesClearedOnHistoryClear)) {
base::HistogramTester histogram_tester;
RegisterWithKeyedService();
......@@ -696,8 +709,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest, IncognitoCanStillRead) {
1);
}
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserTest,
IncognitoDoesntFetchModels) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(IncognitoDoesntFetchModels)) {
SetResponseType(PredictionModelsFetcherRemoteResponseType::
kSuccessfulWithModelsAndFeatures);
base::HistogramTester histogram_tester;
......@@ -756,7 +770,7 @@ class PredictionManagerBrowserSameOriginTest
// Regression test for https://crbug.com/1037945. Tests that the origin of the
// previous navigation is computed correctly.
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserSameOriginTest,
IsSameOriginNavigation) {
DISABLE_ON_WIN_MAC_CHROMEOS(IsSameOriginNavigation)) {
base::HistogramTester histogram_tester;
RegisterWithKeyedService();
......@@ -809,8 +823,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserSameOriginTest,
"OptimizationGuide.PredictionManager.IsSameOrigin", true, 1);
}
IN_PROC_BROWSER_TEST_F(PredictionManagerBrowserSameOriginTest,
ShouldTargetNavigationAsync) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerBrowserSameOriginTest,
DISABLE_ON_WIN_MAC_CHROMEOS(ShouldTargetNavigationAsync)) {
base::HistogramTester histogram_tester;
RegisterWithKeyedService();
......@@ -886,7 +901,8 @@ class PredictionManagerNoUserPermissionsTest
};
IN_PROC_BROWSER_TEST_F(PredictionManagerNoUserPermissionsTest,
HostsAndFieldTrialsNotPassedWhenNoUserPermissions) {
DISABLE_ON_WIN_MAC_CHROMEOS(
HostsAndFieldTrialsNotPassedWhenNoUserPermissions)) {
base::HistogramTester histogram_tester;
SetResponseType(PredictionModelsFetcherRemoteResponseType::
......@@ -990,8 +1006,10 @@ class PredictionManagerModelDownloadingBrowserTest
std::unique_ptr<ModelFileObserver> model_file_observer_;
};
IN_PROC_BROWSER_TEST_F(PredictionManagerModelDownloadingBrowserTest,
TestDownloadUrlAcceptedByDownloadServiceButInvalid) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerModelDownloadingBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(
TestDownloadUrlAcceptedByDownloadServiceButInvalid)) {
base::HistogramTester histogram_tester;
SetResponseType(PredictionModelsFetcherRemoteResponseType::
......@@ -1013,8 +1031,9 @@ IN_PROC_BROWSER_TEST_F(PredictionManagerModelDownloadingBrowserTest,
"OptimizationGuide.PredictionModelUpdateVersion.PainfulPageLoad", 0);
}
IN_PROC_BROWSER_TEST_F(PredictionManagerModelDownloadingBrowserTest,
TestSuccessfulModelFileFlow) {
IN_PROC_BROWSER_TEST_F(
PredictionManagerModelDownloadingBrowserTest,
DISABLE_ON_WIN_MAC_CHROMEOS(TestSuccessfulModelFileFlow)) {
// TODO(crbug/1146151): Remove this switch once we can produce a signed model
// file.
base::CommandLine::ForCurrentProcess()->AppendSwitch(
......
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