From a81304d9844980832ba873fef897dcff8c313b60 Mon Sep 17 00:00:00 2001 From: Darnell Andries Date: Tue, 2 Jul 2024 16:27:32 -0700 Subject: [PATCH] Fix WebDiscovery Windows FilePath append --- .../web_discovery/browser/content_scraper_browsertest.cc | 4 ++-- .../web_discovery/browser/credential_manager_unittest.cc | 3 ++- components/web_discovery/browser/server_config_loader.cc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/web_discovery/browser/content_scraper_browsertest.cc b/components/web_discovery/browser/content_scraper_browsertest.cc index 88b1261fcd9d..5d76e7a9ee77 100644 --- a/components/web_discovery/browser/content_scraper_browsertest.cc +++ b/components/web_discovery/browser/content_scraper_browsertest.cc @@ -50,8 +50,8 @@ class WebDiscoveryContentScraperTest : public PlatformBrowserTest { InitScraper(); run_loop_ = std::make_unique(); - ASSERT_TRUE( - base::ReadFileToString(data_path.Append("page.html"), &page_content_)); + ASSERT_TRUE(base::ReadFileToString(data_path.AppendASCII("page.html"), + &page_content_)); } protected: diff --git a/components/web_discovery/browser/credential_manager_unittest.cc b/components/web_discovery/browser/credential_manager_unittest.cc index 9ed1e461eee2..81ad1c85e34a 100644 --- a/components/web_discovery/browser/credential_manager_unittest.cc +++ b/components/web_discovery/browser/credential_manager_unittest.cc @@ -48,7 +48,8 @@ class WebDiscoveryCredentialManagerTest : public testing::Test { base::PathService::CheckedGet(brave::DIR_TEST_DATA); std::string test_data_json; ASSERT_TRUE(base::ReadFileToString( - data_path.Append("web_discovery/credential_keys_and_responses.json"), + data_path.AppendASCII( + "web_discovery/credential_keys_and_responses.json"), &test_data_json)); auto test_data_value = base::JSONReader::Read(test_data_json); ASSERT_TRUE(test_data_value); diff --git a/components/web_discovery/browser/server_config_loader.cc b/components/web_discovery/browser/server_config_loader.cc index 403d0b9216de..39fb722ea6dc 100644 --- a/components/web_discovery/browser/server_config_loader.cc +++ b/components/web_discovery/browser/server_config_loader.cc @@ -170,7 +170,7 @@ ServerConfigLoader::ServerConfigLoader( quorum_config_url_ = GURL(GetQuorumHost() + kQuorumConfigPath); patterns_url_ = GetPatternsEndpoint(); - patterns_path_ = user_data_dir.Append(kPatternsFilename); + patterns_path_ = user_data_dir.AppendASCII(kPatternsFilename); } ServerConfigLoader::~ServerConfigLoader() = default;