#include "third_party/blink/renderer/platform/loader/fetch/memory_cache.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_context.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_parameters.h"
#include "third_party/blink/renderer/platform/loader/fetch/raw_resource.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_request.h"
#include "third_party/blink/renderer/platform/loader/testing/mock_fetch_context.h"
#include "third_party/blink/renderer/platform/loader/testing/mock_resource.h"
#include "third_party/blink/renderer/platform/loader/testing/test_loader_factory.h"
#include "third_party/blink/renderer/platform/loader/testing/test_resource_fetcher_properties.h"
#include "third_party/blink/renderer/platform/testing/mock_context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h"
namespace blink {
namespace {
constexpr char kResourceURL[] = …;
constexpr char kOriginalRequestDateAsString[] = …;
constexpr char kOneDayBeforeOriginalRequest[] = …;
constexpr char kOneDayAfterOriginalRequest[] = …;
constexpr base::TimeDelta kOneDay = …;
}
class MemoryCacheCorrectnessTest : public testing::Test { … };
TEST_F(MemoryCacheCorrectnessTest, FreshFromLastModified) { … }
TEST_F(MemoryCacheCorrectnessTest, FreshFromExpires) { … }
TEST_F(MemoryCacheCorrectnessTest, FreshFromMaxAge) { … }
TEST_F(MemoryCacheCorrectnessTest, ExpiredFromLastModified) { … }
TEST_F(MemoryCacheCorrectnessTest, ExpiredFromExpires) { … }
TEST_F(MemoryCacheCorrectnessTest, NewMockResourceExpiredFromExpires) { … }
TEST_F(MemoryCacheCorrectnessTest, ReuseMockResourceExpiredFromExpires) { … }
TEST_F(MemoryCacheCorrectnessTest, ExpiredFromMaxAge) { … }
TEST_F(MemoryCacheCorrectnessTest, FreshButNoCache) { … }
TEST_F(MemoryCacheCorrectnessTest, RequestWithNoCache) { … }
TEST_F(MemoryCacheCorrectnessTest, FreshButNoStore) { … }
TEST_F(MemoryCacheCorrectnessTest, RequestWithNoStore) { … }
TEST_F(MemoryCacheCorrectnessTest, DISABLED_FreshButMustRevalidate) { … }
TEST_F(MemoryCacheCorrectnessTest, FreshWithFreshRedirect) { … }
TEST_F(MemoryCacheCorrectnessTest, FreshWithStaleRedirect) { … }
TEST_F(MemoryCacheCorrectnessTest, PostToSameURLTwice) { … }
TEST_F(MemoryCacheCorrectnessTest, 302RedirectNotImplicitlyFresh) { … }
TEST_F(MemoryCacheCorrectnessTest, 302RedirectExplicitlyFreshMaxAge) { … }
TEST_F(MemoryCacheCorrectnessTest, 302RedirectExplicitlyFreshExpires) { … }
}