#include "components/update_client/crx_downloader.h"
#include <utility>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "components/update_client/crx_downloader_factory.h"
#include "components/update_client/net/network_chromium.h"
#include "components/update_client/test_utils.h"
#include "components/update_client/update_client_errors.h"
#include "components/update_client/utils.h"
#include "net/base/net_errors.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
ContentsEqual;
namespace update_client {
namespace {
constexpr char kTestFileName[] = …;
constexpr char hash_jebg[] = …;
}
class CrxDownloaderTest : public testing::Test { … };
CrxDownloaderTest::CrxDownloaderTest()
: … { … }
CrxDownloaderTest::~CrxDownloaderTest() = default;
void CrxDownloaderTest::SetUp() { … }
void CrxDownloaderTest::TearDown() { … }
void CrxDownloaderTest::Quit() { … }
void CrxDownloaderTest::DownloadComplete(const CrxDownloader::Result& result) { … }
void CrxDownloaderTest::DownloadProgress(int64_t downloaded_bytes,
int64_t total_bytes) { … }
void CrxDownloaderTest::AddResponse(const GURL& url,
const base::FilePath& file_path,
int net_error) { … }
void CrxDownloaderTest::RunThreads() { … }
void CrxDownloaderTest::RunThreadsUntilIdle() { … }
TEST_F(CrxDownloaderTest, NoUrl) { … }
TEST_F(CrxDownloaderTest, NoHash) { … }
TEST_F(CrxDownloaderTest, OneUrl) { … }
TEST_F(CrxDownloaderTest, OneUrlBadHash) { … }
TEST_F(CrxDownloaderTest, TwoUrls) { … }
TEST_F(CrxDownloaderTest, TwoUrls_FirstInvalid) { … }
TEST_F(CrxDownloaderTest, TwoUrls_SecondInvalid) { … }
TEST_F(CrxDownloaderTest, TwoUrls_BothInvalid) { … }
}