Commit d82a7dce authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Do not instantiate base::FieldTrialList explicitly in tests

The test suite already instantiates a FieldTrialList as per
https://chromium-review.googlesource.com/c/chromium/src/+/1883567 so
it's no longer necessary to do so explicitly in tests.

This patch addresses unit tests under:
/components/safe_browsing

This CL was uploaded by git cl split.

R=nparker@chromium.org

Bug: 1018667
Change-Id: Id49d230fa4bb9512d44120f21c30debe624a9c8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1917763
Auto-Submit: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarNathan Parker <nparker@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715763}
parent bcb03288
......@@ -37,8 +37,7 @@ class TestSafeBrowsingApiHandler : public SafeBrowsingApiHandler {
class RemoteDatabaseManagerTest : public testing::Test {
protected:
RemoteDatabaseManagerTest()
: field_trials_(new base::FieldTrialList(nullptr)) {}
RemoteDatabaseManagerTest() {}
void SetUp() override {
SafeBrowsingApiHandler::SetInstance(&api_handler_);
......@@ -52,10 +51,6 @@ class RemoteDatabaseManagerTest : public testing::Test {
// Setup the two field trial params. These are read in db_'s ctor.
void SetFieldTrialParams(const std::string types_to_check_val) {
// Destroy the existing FieldTrialList before creating a new one to avoid
// a DCHECK.
field_trials_.reset();
field_trials_.reset(new base::FieldTrialList(nullptr));
variations::testing::ClearAllVariationIDs();
variations::testing::ClearAllVariationParams();
......@@ -73,7 +68,6 @@ class RemoteDatabaseManagerTest : public testing::Test {
}
content::BrowserTaskEnvironment task_environment_;
std::unique_ptr<base::FieldTrialList> field_trials_;
TestSafeBrowsingApiHandler api_handler_;
scoped_refptr<RemoteSafeBrowsingDatabaseManager> db_;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment