#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/update_client/utils.h"
#include <string>
#include <utility>
#include <vector>
#include "base/base_paths.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/process/launch.h"
#include "base/process/process.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "components/update_client/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_WIN)
#include <shlobj.h>
#endif
namespace update_client {
TEST(UpdateClientUtils, VerifyFileHash256) { … }
TEST(UpdateClientUtils, IsValidBrand) { … }
TEST(UpdateClientUtils, GetCrxComponentId) { … }
TEST(UpdateClientUtils, GetCrxIdFromPublicKeyHash) { … }
TEST(UpdateClientUtils, IsValidInstallerAttributeName) { … }
TEST(UpdateClientUtils, IsValidInstallerAttributeValue) { … }
TEST(UpdateClientUtils, RemoveUnsecureUrls) { … }
TEST(UpdateClientUtils, GetArchitecture) { … }
namespace {
#if BUILDFLAG(IS_WIN)
base::FilePath CopyCmdExe(const base::FilePath& under_dir) {
constexpr wchar_t kCmdExe[] = L"cmd.exe";
base::FilePath system_path;
EXPECT_TRUE(base::PathService::Get(base::DIR_SYSTEM, &system_path));
const base::FilePath cmd_exe_path = under_dir.Append(kCmdExe);
EXPECT_TRUE(base::CopyFile(system_path.Append(kCmdExe), cmd_exe_path));
return cmd_exe_path;
}
#endif
}
TEST(UpdateClientUtils, RetryDeletePathRecursively) { … }
}