#include "chrome/browser/resources_integrity.h"
#include <algorithm>
#include "base/functional/bind.h"
#include "base/path_service.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "chrome/app/packed_resources_integrity.h"
#include "chrome/browser/buildflags.h"
#include "chrome/common/chrome_paths.h"
#include "testing/gtest/include/gtest/gtest.h"
class CheckResourceIntegrityTest : public testing::Test { … };
TEST_F(CheckResourceIntegrityTest, Match) { … }
TEST_F(CheckResourceIntegrityTest, Mismatch) { … }
TEST_F(CheckResourceIntegrityTest, NonExistentFile) { … }
#if BUILDFLAG(IS_WIN)
extern "C" __declspec(dllexport) __cdecl void GetPakFileHashes(
const uint8_t** resources_pak,
const uint8_t** chrome_100_pak,
const uint8_t** chrome_200_pak) {
*resources_pak = kSha256_resources_pak.data();
*chrome_100_pak = kSha256_chrome_100_percent_pak.data();
*chrome_200_pak = kSha256_chrome_200_percent_pak.data();
}
#endif
TEST_F(CheckResourceIntegrityTest, ChromePaks) { … }