#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/profiles/profile_io_data.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "extensions/common/switches.h"
#include "extensions/test/result_catcher.h"
#include "net/base/backoff_entry.h"
#include "net/base/features.h"
#include "net/base/url_util.h"
#include "net/dns/mock_host_resolver.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"
namespace extensions {
namespace {
std::unique_ptr<net::test_server::HttpResponse> HandleRequest(
bool set_cache_header_redirect_page,
bool set_cache_header_test_throttle_page,
const net::test_server::HttpRequest& request) { … }
}
class ExtensionURLLoaderThrottleBrowserTest : public ExtensionBrowserTest { … };
class ExtensionURLLoaderThrottleWithSplitCacheBrowserTest
: public ExtensionURLLoaderThrottleBrowserTest,
public ::testing::WithParamInterface<bool> { … };
IN_PROC_BROWSER_TEST_P(ExtensionURLLoaderThrottleWithSplitCacheBrowserTest,
ThrottleRequest) { … }
IN_PROC_BROWSER_TEST_P(ExtensionURLLoaderThrottleWithSplitCacheBrowserTest,
DoNotThrottleCachedResponse) { … }
IN_PROC_BROWSER_TEST_P(ExtensionURLLoaderThrottleWithSplitCacheBrowserTest,
ThrottleRequest_Redirect) { … }
IN_PROC_BROWSER_TEST_P(ExtensionURLLoaderThrottleWithSplitCacheBrowserTest,
DoNotThrottleCachedResponse_Redirect) { … }
IN_PROC_BROWSER_TEST_P(ExtensionURLLoaderThrottleWithSplitCacheBrowserTest,
ThrottleRequest_RedirectCached) { … }
IN_PROC_BROWSER_TEST_P(ExtensionURLLoaderThrottleWithSplitCacheBrowserTest,
DoNotThrottleCachedResponse_NonRedirectCached) { … }
INSTANTIATE_TEST_SUITE_P(…);
class ExtensionURLLoaderThrottleCommandLineBrowserTest
: public ExtensionURLLoaderThrottleBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ExtensionURLLoaderThrottleCommandLineBrowserTest,
ThrottleRequestDisabled) { … }
}