| Index: components/update_client/update_checker_unittest.cc
|
| diff --git a/components/update_client/update_checker_unittest.cc b/components/update_client/update_checker_unittest.cc
|
| index 26873c7a1118e3277d76f938caebf596a160d2b3..334899611f8323b22e910f0645b5037572e22c1b 100644
|
| --- a/components/update_client/update_checker_unittest.cc
|
| +++ b/components/update_client/update_checker_unittest.cc
|
| @@ -47,7 +47,9 @@ class UpdateCheckerTest : public testing::Test {
|
| void SetUp() override;
|
| void TearDown() override;
|
|
|
| - void UpdateCheckComplete(int error, const UpdateResponse::Results& results);
|
| + void UpdateCheckComplete(int error,
|
| + const UpdateResponse::Results& results,
|
| + int retry_after_sec);
|
|
|
| protected:
|
| void Quit();
|
| @@ -129,7 +131,8 @@ void UpdateCheckerTest::Quit() {
|
|
|
| void UpdateCheckerTest::UpdateCheckComplete(
|
| int error,
|
| - const UpdateResponse::Results& results) {
|
| + const UpdateResponse::Results& results,
|
| + int retry_after_sec) {
|
| error_ = error;
|
| results_ = results;
|
| Quit();
|
| @@ -308,4 +311,25 @@ TEST_F(UpdateCheckerTest, UpdateCheckCupError) {
|
| EXPECT_EQ(0ul, results_.list.size());
|
| }
|
|
|
| +// Tests that the UpdateCheckers will not make an update check for a
|
| +// component that requires encryption when the update check URL is unsecure.
|
| +TEST_F(UpdateCheckerTest, UpdateCheckRequiresEncryptionError) {
|
| + config_->SetUpdateCheckUrl(GURL("http:\\foo\bar"));
|
| +
|
| + update_checker_ = UpdateChecker::Create(config_);
|
| +
|
| + CrxUpdateItem item(BuildCrxUpdateItem());
|
| + item.component.requires_network_encryption = true;
|
| + std::vector<CrxUpdateItem*> items_to_check;
|
| + items_to_check.push_back(&item);
|
| +
|
| + update_checker_->CheckForUpdates(
|
| + items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
|
| + base::Unretained(this)));
|
| + RunThreads();
|
| +
|
| + EXPECT_EQ(-1, error_);
|
| + EXPECT_EQ(0u, results_.list.size());
|
| +}
|
| +
|
| } // namespace update_client
|
|
|