diff --git a/components/web_discovery/browser/double_fetcher_unittest.cc b/components/web_discovery/browser/double_fetcher_unittest.cc index 10af940221a1..b1997ad1381d 100644 --- a/components/web_discovery/browser/double_fetcher_unittest.cc +++ b/components/web_discovery/browser/double_fetcher_unittest.cc @@ -56,17 +56,6 @@ class WebDiscoveryDoubleFetcherTest : public testing::Test { url_loader_factory_.AddResponse(kTestUrl, kTestResponseText, status); } - base::test::TaskEnvironment task_environment_; - struct CompletedFetch { - GURL url; - base::Value associated_data; - std::optional response_body; - }; - std::unique_ptr double_fetcher_; - std::vector completed_fetches_; - network::TestURLLoaderFactory url_loader_factory_; - - private: void HandleDoubleFetch(const GURL& url, const base::Value& associated_data, std::optional response_body) { @@ -76,8 +65,18 @@ class WebDiscoveryDoubleFetcherTest : public testing::Test { .response_body = response_body}); } + base::test::TaskEnvironment task_environment_; TestingPrefServiceSimple profile_prefs_; scoped_refptr shared_url_loader_factory_; + + struct CompletedFetch { + GURL url; + base::Value associated_data; + std::optional response_body; + }; + std::unique_ptr double_fetcher_; + std::vector completed_fetches_; + network::TestURLLoaderFactory url_loader_factory_; }; TEST_F(WebDiscoveryDoubleFetcherTest, ScheduleAndFetch) { diff --git a/components/web_discovery/browser/reporter_unittest.cc b/components/web_discovery/browser/reporter_unittest.cc index 77460d79746a..31074adbc05e 100644 --- a/components/web_discovery/browser/reporter_unittest.cc +++ b/components/web_discovery/browser/reporter_unittest.cc @@ -112,13 +112,6 @@ class WebDiscoveryReporterTest : public testing::Test { return payload; } - base::test::TaskEnvironment task_environment_; - std::unique_ptr reporter_; - TestCredentialSigner credential_signer_; - size_t report_requests_made_ = 0; - net::HttpStatusCode submit_status_code_ = net::HTTP_OK; - - private: void HandleRequest(const network::ResourceRequest& request) { url_loader_factory_.ClearResponses(); @@ -145,10 +138,16 @@ class WebDiscoveryReporterTest : public testing::Test { report_requests_made_++; } - std::unique_ptr server_config_loader_; + base::test::TaskEnvironment task_environment_; TestingPrefServiceSimple profile_prefs_; network::TestURLLoaderFactory url_loader_factory_; scoped_refptr shared_url_loader_factory_; + std::unique_ptr server_config_loader_; + + std::unique_ptr reporter_; + TestCredentialSigner credential_signer_; + size_t report_requests_made_ = 0; + net::HttpStatusCode submit_status_code_ = net::HTTP_OK; }; TEST_F(WebDiscoveryReporterTest, BasicReport) {