Skip to content

Commit 68d8aed

Browse files
authored
Disable site affiliation fetcher (uplift to 1.52.x) (#18285)
Uplift of #18153 (squashed) to beta
1 parent b803b35 commit 68d8aed

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

browser/net/brave_network_audit_browsertest.cc

+14
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "brave/browser/ui/brave_browser.h"
2222
#include "brave/components/brave_rewards/browser/rewards_service_impl.h"
2323
#include "brave/components/playlist/common/buildflags/buildflags.h"
24+
#include "chrome/browser/password_manager/password_store_factory.h"
2425
#include "chrome/browser/profiles/profile.h"
2526
#include "chrome/browser/ui/browser.h"
2627
#include "chrome/test/base/in_process_browser_test.h"
@@ -300,6 +301,19 @@ IN_PROC_BROWSER_TEST_F(BraveNetworkAuditTest, BasicTests) {
300301
ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GURL("brave://welcome")));
301302
WaitForTimeout(kMaxTimeoutPerLoadedURL);
302303

304+
// Add a password to the password manager.
305+
password_manager::PasswordStoreInterface* password_store =
306+
PasswordStoreFactory::GetForProfile(browser()->profile(),
307+
ServiceAccessType::IMPLICIT_ACCESS)
308+
.get();
309+
password_manager::PasswordForm signin_form;
310+
signin_form.signon_realm = "https://www.facebook.com/";
311+
signin_form.url = GURL("https://www.facebook.com/");
312+
signin_form.action = GURL("https://www.facebook.com/");
313+
signin_form.username_value = u"john";
314+
signin_form.password_value = u"password1";
315+
password_store->AddLogin(signin_form);
316+
303317
// Load the NTP to check requests made from the JS widgets.
304318
ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GURL("brave://newtab")));
305319
WaitForTimeout(kMaxTimeoutPerLoadedURL);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* Copyright (c) 2023 The Brave Authors. All rights reserved.
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
* You can obtain one at https://mozilla.org/MPL/2.0/. */
5+
6+
#include "components/password_manager/core/browser/affiliation/hash_affiliation_fetcher.h"
7+
8+
namespace {
9+
10+
class BraveHashAffiliationFetcher
11+
: public password_manager::HashAffiliationFetcher {
12+
public:
13+
using HashAffiliationFetcher::HashAffiliationFetcher;
14+
15+
void StartRequest(const std::vector<password_manager::FacetURI>& facet_uris,
16+
RequestInfo request_info) override {}
17+
};
18+
19+
} // namespace
20+
21+
#define HashAffiliationFetcher BraveHashAffiliationFetcher
22+
#include "src/components/password_manager/core/browser/affiliation/affiliation_fetcher_factory_impl.cc"
23+
#undef HashAffiliationFetcher

0 commit comments

Comments
 (0)