chromium/chrome/browser/resources_integrity_unittest.cc

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

#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)
// On Windows, CheckPakFileIntegrity() dynamically finds this symbol from its
// main exe module (normally chrome.exe). In unit_tests.exe, provide the same
// export.
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  // BUILDFLAG(IS_WIN)

TEST_F(CheckResourceIntegrityTest, ChromePaks) {}