#include <memory>
#include <string>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/test/bind.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/browsertest_util.h"
#include "chrome/browser/extensions/chrome_content_verifier_delegate.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/url_loader_interceptor.h"
#include "extensions/browser/computed_hashes.h"
#include "extensions/browser/content_verifier/test_utils.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/common/file_util.h"
#include "services/network/public/cpp/features.h"
namespace extensions {
namespace {
enum ContentVerificationMode { … };
}
class ContentVerifierHashTest
: public ExtensionBrowserTest,
public testing::WithParamInterface<ContentVerificationMode> { … };
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
DISABLED_TamperRequestedResourceKeepComputedHashes) { … }
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
TamperRequestedResourceDeleteComputedHashes) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_TamperRequestedResourceTamperComputedHashes …
#else
#define MAYBE_TamperRequestedResourceTamperComputedHashes …
#endif
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
MAYBE_TamperRequestedResourceTamperComputedHashes) { … }
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
FetchFailureWithDefaultResourceExtension) { … }
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
FetchFailureWithNoDefaultResourceDoesNotDisable) { … }
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
TamperNotRequestedResourceKeepComputedHashes) { … }
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
TamperNoResourceExtensionDeleteComputedHashes) { … }
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
TamperNoResourceExtensionKeepComputedHashes) { … }
IN_PROC_BROWSER_TEST_P(ContentVerifierHashTest,
TamperNoResourceExtensionTamperComputedHashes) { … }
IN_PROC_BROWSER_TEST_P(
ContentVerifierHashTest,
DefaultRequestExtensionTamperNotRequestedResourceKeepComputedHashes) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_DefaultRequestExtensionTamperNotRequestedResourceTamperComputedHashes …
#else
#define MAYBE_DefaultRequestExtensionTamperNotRequestedResourceTamperComputedHashes …
#endif
IN_PROC_BROWSER_TEST_P(
ContentVerifierHashTest,
MAYBE_DefaultRequestExtensionTamperNotRequestedResourceTamperComputedHashes) { … }
IN_PROC_BROWSER_TEST_P(
ContentVerifierHashTest,
DefaultRequestExtensionTamperNotRequestedResourceDeleteComputedHashes) { … }
INSTANTIATE_TEST_SUITE_P(…);
}