#include "base/barrier_closure.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.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_content_browser_client.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 "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/system/sys_info.h"
#endif
namespace content {
namespace {
class MockContentBrowserClient final
: public ContentBrowserTestContentBrowserClient { … };
class DoNotTrackTest : public ContentBrowserTest { … };
std::unique_ptr<net::test_server::HttpResponse>
CaptureHeaderHandlerAndReturnScript(
const std::string& path,
net::test_server::HttpRequest::HeaderMap* header_map,
const std::string& script,
base::OnceClosure done_callback,
const net::test_server::HttpRequest& request) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, NotEnabled) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, Simple) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, Redirect) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, DOMProperty) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, Worker) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_SharedWorker …
#else
#define MAYBE_SharedWorker …
#endif
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, MAYBE_SharedWorker) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, ServiceWorker_Register) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, ModuleServiceWorker_Register) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest,
StaticImportModuleServiceWorker_Register) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, ServiceWorker_Update) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, ModuleServiceWorker_Update) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, StaticImportModuleServiceWorker_Update) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, FetchFromWorker) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_FetchFromSharedWorker …
#else
#define MAYBE_FetchFromSharedWorker …
#endif
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, MAYBE_FetchFromSharedWorker) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest, FetchFromServiceWorker) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest,
FetchFromServiceWorkerControlledPage_NoFetchHandler) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest,
FetchFromServiceWorkerControlledPage_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(DoNotTrackTest,
FetchFromServiceWorkerControlledPage_RespondWithFetch) { … }
}
}