Skip to content

Commit

Permalink
Merge pull request #18153 from brave/disable-hash-affiliation-service…
Browse files Browse the repository at this point in the history
…-29872

Disable site affiliation fetcher
  • Loading branch information
fmarier authored Apr 27, 2023
2 parents 839d3e8 + 0c01bd6 commit 5f32b7e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
14 changes: 14 additions & 0 deletions browser/net/brave_network_audit_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "brave/browser/ui/brave_browser.h"
#include "brave/components/brave_rewards/browser/rewards_service_impl.h"
#include "brave/components/playlist/common/buildflags/buildflags.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
Expand Down Expand Up @@ -300,6 +301,19 @@ IN_PROC_BROWSER_TEST_F(BraveNetworkAuditTest, BasicTests) {
ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GURL("brave://welcome")));
WaitForTimeout(kMaxTimeoutPerLoadedURL);

// Add a password to the password manager.
password_manager::PasswordStoreInterface* password_store =
PasswordStoreFactory::GetForProfile(browser()->profile(),
ServiceAccessType::IMPLICIT_ACCESS)
.get();
password_manager::PasswordForm signin_form;
signin_form.signon_realm = "https://www.facebook.com/";
signin_form.url = GURL("https://www.facebook.com/");
signin_form.action = GURL("https://www.facebook.com/");
signin_form.username_value = u"john";
signin_form.password_value = u"password1";
password_store->AddLogin(signin_form);

// Load the NTP to check requests made from the JS widgets.
ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GURL("brave://newtab")));
WaitForTimeout(kMaxTimeoutPerLoadedURL);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* 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 "components/password_manager/core/browser/affiliation/hash_affiliation_fetcher.h"

namespace {

class BraveHashAffiliationFetcher
: public password_manager::HashAffiliationFetcher {
public:
using HashAffiliationFetcher::HashAffiliationFetcher;

void StartRequest(const std::vector<password_manager::FacetURI>& facet_uris,
RequestInfo request_info) override {}
};

} // namespace

#define HashAffiliationFetcher BraveHashAffiliationFetcher
#include "src/components/password_manager/core/browser/affiliation/affiliation_fetcher_factory_impl.cc"
#undef HashAffiliationFetcher

0 comments on commit 5f32b7e

Please sign in to comment.