Commit 1ff8263a authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

HttpServerProperties: Add test for a (fixed) infinite loop bug.

https://chromium-review.googlesource.com/c/chromium/src/+/1758546
is the fix for the bug itself.

Bug: 994537
Change-Id: I7850325a19fd41e8b08040a69201df9251a78690
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758717
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691751}
parent a20ddd18
......@@ -1625,6 +1625,33 @@ TEST_F(AlternateProtocolServerPropertiesTest, RemoveExpiredBrokenAltSvc2) {
EXPECT_FALSE(impl_.IsAlternativeServiceBroken(alternative_service2));
}
// Regression test for https://crbug.com/994537. Having a ServerInfo entry
// without a populated |alternative_services| value would cause
// OnExpireBrokenAlternativeService() to hang..
TEST_F(AlternateProtocolServerPropertiesTest, RemoveExpiredBrokenAltSvc3) {
// Add an altertive service entry.
const url::SchemeHostPort kServer1("https", "foo", 443);
const AlternativeService kAltService(kProtoQUIC, "bar", 443);
SetAlternativeService(kServer1, kAltService);
EXPECT_TRUE(HasAlternativeService(kServer1, NetworkIsolationKey()));
// Add an entry to ServerInfo for another server, without an alternative
// service value.
const url::SchemeHostPort kServer2("http", "bar", 80);
impl_.SetSupportsSpdy(kServer2, NetworkIsolationKey(), false);
// Mark kAltService as broken.
base::TimeTicks past =
test_tick_clock_->NowTicks() - base::TimeDelta::FromSeconds(42);
HttpServerPropertiesPeer::AddBrokenAlternativeServiceWithExpirationTime(
&impl_, kAltService, past);
// Expire brokenness of kAltService. This call should not hang.
HttpServerPropertiesPeer::ExpireBrokenAlternateProtocolMappings(&impl_);
EXPECT_FALSE(HasAlternativeService(kServer1, NetworkIsolationKey()));
}
TEST_F(AlternateProtocolServerPropertiesTest,
GetAlternativeServiceInfoAsValue) {
base::Time::Exploded now_exploded;
......
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