Commit 28cfce3f authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Fix MemoryCacheCorrectnessTest.ExpiredFromLastModified

The test was leaky when introduced, so it got DISABLED. Making Resource
garbage collected solved the leak problem, but another change (probably
https://crrev.com/aadbd2624c5003698624cf2e21fd6ae876e28629) broke the
test silently.

Bug: 340306
Change-Id: I5a5b2e619831fefd1ac9183fed9cff1293768e1c
Reviewed-on: https://chromium-review.googlesource.com/c/1474884Reviewed-by: default avatarHiroshige Hayashizaki <hiroshige@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632787}
parent 6ce4b219
......@@ -187,9 +187,7 @@ TEST_F(MemoryCacheCorrectnessTest, FreshFromMaxAge) {
EXPECT_EQ(fresh200, fetched);
}
// The strong validator causes a revalidation to be launched, and the proxy and
// original resources leak because of their reference loop.
TEST_F(MemoryCacheCorrectnessTest, DISABLED_ExpiredFromLastModified) {
TEST_F(MemoryCacheCorrectnessTest, ExpiredFromLastModified) {
ResourceResponse expired200_response;
expired200_response.SetHTTPStatusCode(200);
expired200_response.SetHTTPHeaderField("Date", kOriginalRequestDateAsString);
......@@ -201,8 +199,13 @@ TEST_F(MemoryCacheCorrectnessTest, DISABLED_ExpiredFromLastModified) {
// Advance the clock beyond the implicit freshness period.
AdvanceClock(24. * 60. * 60. * 0.2);
EXPECT_FALSE(expired200->ErrorOccurred());
MockResource* fetched = FetchMockResource();
EXPECT_NE(expired200, fetched);
// We want to make sure that revalidation happens, and we are checking the
// ResourceStatus because in this case the revalidation request fails
// synchronously.
EXPECT_EQ(expired200, fetched);
EXPECT_TRUE(expired200->ErrorOccurred());
}
TEST_F(MemoryCacheCorrectnessTest, ExpiredFromExpires) {
......
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