Commit b7258611 authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Remove NetworkIsolationKey::Todo() in test files.

This is used to track areas where we need to fill in empty
NetworkIsolationKeys with the correct value. While we certainly should
add tests when we do this, keeping Todo()s in tests makes it harder to
audit the production code where we need to wire up NIKs.

Bug: None
Change-Id: I99fcca16a2b2d9a266444512c19bddaba2cc77a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222524
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: default avatarLily Chen <chlily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773241}
parent 9f8c5ed6
...@@ -199,8 +199,7 @@ class SQLitePersistentReportingAndNelStoreTest ...@@ -199,8 +199,7 @@ class SQLitePersistentReportingAndNelStoreTest
info.priority = priority; info.priority = priority;
info.weight = weight; info.weight = weight;
ReportingEndpoint endpoint( ReportingEndpoint endpoint(
ReportingEndpointGroupKey(NetworkIsolationKey::Todo(), origin, ReportingEndpointGroupKey(NetworkIsolationKey(), origin, group_name),
group_name),
std::move(info)); std::move(info));
return endpoint; return endpoint;
} }
...@@ -212,8 +211,7 @@ class SQLitePersistentReportingAndNelStoreTest ...@@ -212,8 +211,7 @@ class SQLitePersistentReportingAndNelStoreTest
OriginSubdomains include_subdomains = OriginSubdomains::DEFAULT, OriginSubdomains include_subdomains = OriginSubdomains::DEFAULT,
base::Time expires = kExpires) { base::Time expires = kExpires) {
return CachedReportingEndpointGroup( return CachedReportingEndpointGroup(
ReportingEndpointGroupKey(NetworkIsolationKey::Todo(), origin, ReportingEndpointGroupKey(NetworkIsolationKey(), origin, group_name),
group_name),
include_subdomains, expires, last_used); include_subdomains, expires, last_used);
} }
......
...@@ -43,15 +43,15 @@ class ReportingBrowsingDataRemoverTest : public ReportingTestBase { ...@@ -43,15 +43,15 @@ class ReportingBrowsingDataRemoverTest : public ReportingTestBase {
// TODO(chlily): Take NIK. // TODO(chlily): Take NIK.
void AddReport(const GURL& url) { void AddReport(const GURL& url) {
cache()->AddReport(NetworkIsolationKey::Todo(), url, kUserAgent_, kGroup_, cache()->AddReport(NetworkIsolationKey(), url, kUserAgent_, kGroup_, kType_,
kType_, std::make_unique<base::DictionaryValue>(), 0, std::make_unique<base::DictionaryValue>(), 0,
tick_clock()->NowTicks(), 0); tick_clock()->NowTicks(), 0);
} }
// TODO(chlily): Take NIK. // TODO(chlily): Take NIK.
void SetEndpoint(const url::Origin& origin) { void SetEndpoint(const url::Origin& origin) {
SetEndpointInCache( SetEndpointInCache(
ReportingEndpointGroupKey(NetworkIsolationKey::Todo(), origin, kGroup_), ReportingEndpointGroupKey(NetworkIsolationKey(), origin, kGroup_),
kEndpoint_, base::Time::Now() + base::TimeDelta::FromDays(7)); kEndpoint_, base::Time::Now() + base::TimeDelta::FromDays(7));
} }
...@@ -154,14 +154,12 @@ TEST_F(ReportingBrowsingDataRemoverTest, RemoveSomeClients) { ...@@ -154,14 +154,12 @@ TEST_F(ReportingBrowsingDataRemoverTest, RemoveSomeClients) {
RemoveBrowsingData(/* remove_reports= */ false, /* remove_clients= */ true, RemoveBrowsingData(/* remove_reports= */ false, /* remove_clients= */ true,
/* host= */ kUrl1_.host()); /* host= */ kUrl1_.host());
EXPECT_EQ(2u, report_count()); EXPECT_EQ(2u, report_count());
EXPECT_FALSE( EXPECT_FALSE(FindEndpointInCache(
FindEndpointInCache(ReportingEndpointGroupKey(NetworkIsolationKey::Todo(), ReportingEndpointGroupKey(NetworkIsolationKey(), kOrigin1_, kGroup_),
kOrigin1_, kGroup_), kEndpoint_));
kEndpoint_)); EXPECT_TRUE(FindEndpointInCache(
EXPECT_TRUE( ReportingEndpointGroupKey(NetworkIsolationKey(), kOrigin2_, kGroup_),
FindEndpointInCache(ReportingEndpointGroupKey(NetworkIsolationKey::Todo(), kEndpoint_));
kOrigin2_, kGroup_),
kEndpoint_));
} }
} // namespace } // namespace
......
...@@ -44,11 +44,9 @@ class ReportingServiceTest : public ::testing::TestWithParam<bool>, ...@@ -44,11 +44,9 @@ class ReportingServiceTest : public ::testing::TestWithParam<bool>,
const std::string kGroup_ = "group"; const std::string kGroup_ = "group";
const std::string kType_ = "type"; const std::string kType_ = "type";
const ReportingEndpointGroupKey kGroupKey_ = const ReportingEndpointGroupKey kGroupKey_ =
ReportingEndpointGroupKey(NetworkIsolationKey::Todo(), kOrigin_, kGroup_); ReportingEndpointGroupKey(NetworkIsolationKey(), kOrigin_, kGroup_);
const ReportingEndpointGroupKey kGroupKey2_ = const ReportingEndpointGroupKey kGroupKey2_ =
ReportingEndpointGroupKey(NetworkIsolationKey::Todo(), ReportingEndpointGroupKey(NetworkIsolationKey(), kOrigin2_, kGroup_);
kOrigin2_,
kGroup_);
ReportingServiceTest() { ReportingServiceTest() {
if (GetParam()) if (GetParam())
......
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