chromium/content/browser/loader/reload_cache_control_browsertest.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <memory>
#include <string>
#include <vector>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace content {

namespace {

HttpRequest;
HttpResponse;

const char kReloadTestPath[] =;
// The test page should request resources as the content structure is described
// below. Reload and the same page navigation will affect only the top frame
// resource, reload_test.html. But bypassing reload will affect all resources.
// +- reload_test.html
//     +- empty16x16.png
//     +- simple_frame.html
//         +- empty16x16.png

const char kNoCacheControl[] =;
const char kMaxAgeCacheControl[] =;
const char kNoCacheCacheControl[] =;

struct RequestLog {};

struct ExpectedCacheControl {};

const ExpectedCacheControl kExpectedCacheControlForNormalLoad =;
const ExpectedCacheControl kExpectedCacheControlForReload =;
const ExpectedCacheControl kExpectedCacheControlForBypassingReload =;

// Tests end to end behaviors between Blink and content around reload variants.
class ReloadCacheControlBrowserTest : public ContentBrowserTest {};

// Test if reload issues requests with proper cache control flags.
IN_PROC_BROWSER_TEST_F(ReloadCacheControlBrowserTest, NormalReload) {}

// Test if bypassing reload issues requests with proper cache control flags.
IN_PROC_BROWSER_TEST_F(ReloadCacheControlBrowserTest, BypassingReload) {}

// Test if the same page navigation issues requests with proper cache control
// flags.
IN_PROC_BROWSER_TEST_F(ReloadCacheControlBrowserTest, NavigateToSame) {}

// Reloading with ReloadType::NORMAL should respect service workers.
IN_PROC_BROWSER_TEST_F(ReloadCacheControlBrowserTest,
                       NormalReload_ControlledByServiceWorker) {}

// Reloading with ReloadType::BYPASSING_CACHE should bypass service workers.
IN_PROC_BROWSER_TEST_F(ReloadCacheControlBrowserTest,
                       BypassingReload_ControlledByServiceWorker) {}

}  // namespace

}  // namespace content