From 08ae7f1af131a9a3bbfe4dde7bf510fe0b39b1b7 Mon Sep 17 00:00:00 2001 From: Emerick Rogul Date: Wed, 24 May 2023 07:06:42 -0400 Subject: [PATCH] Merge pull request #18550 from brave/cr114-followup-remove-cookies-toggle-from-site-data-popup Hide third-party cookies toggle from Cookies and Site Data popup --- app/BUILD.gn | 1 + app/brave_main_delegate_browsertest.cc | 2 ++ .../components/page_info/core/features.cc | 19 +++++++++++++++++++ test/filters/browser_tests.filter | 4 ++++ test/filters/unit_tests.filter | 3 +++ 5 files changed, 29 insertions(+) create mode 100644 chromium_src/components/page_info/core/features.cc diff --git a/app/BUILD.gn b/app/BUILD.gn index 95cb2d66f717..428cb70cb371 100644 --- a/app/BUILD.gn +++ b/app/BUILD.gn @@ -107,6 +107,7 @@ source_set("browser_tests") { "//components/omnibox/browser", "//components/optimization_guide/core", "//components/page_image_service", + "//components/page_info/core", "//components/performance_manager", "//components/permissions", "//components/privacy_sandbox", diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc index 972a4fa96a5c..9617ae571a60 100644 --- a/app/brave_main_delegate_browsertest.cc +++ b/app/brave_main_delegate_browsertest.cc @@ -29,6 +29,7 @@ #include "components/omnibox/common/omnibox_features.h" #include "components/optimization_guide/core/optimization_guide_features.h" #include "components/page_image_service/features.h" +#include "components/page_info/core/features.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/performance_manager/public/features.h" #include "components/permissions/features.h" @@ -210,6 +211,7 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { kRemoteOptimizationGuideFetchingAnonymousDataConsent, &page_image_service::kImageServiceSuggestPoweredImages, #if !BUILDFLAG(IS_ANDROID) + &page_info::kPageInfoCookiesSubpage, &permissions::features::kPermissionsPromptSurvey, &permissions::features::kPermissionStorageAccessAPI, &permissions::features::kRecordPermissionExpirationTimestamps, diff --git a/chromium_src/components/page_info/core/features.cc b/chromium_src/components/page_info/core/features.cc new file mode 100644 index 000000000000..89183dbe8621 --- /dev/null +++ b/chromium_src/components/page_info/core/features.cc @@ -0,0 +1,19 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "src/components/page_info/core/features.cc" + +#include "base/feature_override.h" +#include "build/build_config.h" + +namespace page_info { + +OVERRIDE_FEATURE_DEFAULT_STATES({{ +#if !BUILDFLAG(IS_ANDROID) + {kPageInfoCookiesSubpage, base::FEATURE_DISABLED_BY_DEFAULT}, +#endif +}}); + +} // namespace page_info diff --git a/test/filters/browser_tests.filter b/test/filters/browser_tests.filter index 3dfbaf7e524c..7a741c39cb28 100644 --- a/test/filters/browser_tests.filter +++ b/test/filters/browser_tests.filter @@ -693,6 +693,10 @@ -CommerceHintFeatureDefaultWithGeoTest.EnableWithGeo -NewTabPageUtilBrowserTest.EnableCartByToT +# These tests fail because we disable page_info::kPageInfoCookiesSubpage +-PageInfoBubbleViewBrowserTestCookiesSubpage.ClickingFpsButton +-PageInfoBubbleViewBrowserTestCookiesSubpage.ToggleForBlockingThirdPartyCookies + # Tests below this point have not been diagnosed or had issues created yet. -_/WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled.* -AccessCodeCastHandlerBrowserTest.* diff --git a/test/filters/unit_tests.filter b/test/filters/unit_tests.filter index ff3fcbad3c0f..656a832c33aa 100644 --- a/test/filters/unit_tests.filter +++ b/test/filters/unit_tests.filter @@ -307,6 +307,9 @@ # the empty string. -CommanderFuzzyFinder.EmptyStringDoesNotMatch +# This test fails because we disable page_info::kPageInfoCookiesSubpage +-PageInfoBubbleViewCookiesSubpageTest.TextsOnButtonsAreCorrect + # Tests below this point have not been diagnosed or had issues created yet. -AboutFlagsHistogramTest.* -AboutFlagsTest.*