Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: components/update_client/update_checker_unittest.cc

Issue 2237153002: Use consistent values for enabled_component_updates throughout an update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UT. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/update_client/update_checker.cc ('k') | components/update_client/update_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 96889f2def6eb9727ed167a7a8a1f71d9531987d..19592c5866a5473dfd8760cf4e34c9364c53642b 100644
--- a/components/update_client/update_checker_unittest.cc
+++ b/components/update_client/update_checker_unittest.cc
@@ -175,7 +175,7 @@ TEST_F(UpdateCheckerTest, UpdateCheckSuccess) {
items_to_check.push_back(&item);
update_checker_->CheckForUpdates(
- items_to_check, "extra=\"params\"",
+ items_to_check, "extra=\"params\"", true,
base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
base::Unretained(this)));
@@ -226,8 +226,9 @@ TEST_F(UpdateCheckerTest, UpdateCheckInvalidAp) {
items_to_check.push_back(&item);
update_checker_->CheckForUpdates(
- items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
- base::Unretained(this)));
+ items_to_check, "", true,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
@@ -253,8 +254,9 @@ TEST_F(UpdateCheckerTest, UpdateCheckSuccessNoBrand) {
items_to_check.push_back(&item);
update_checker_->CheckForUpdates(
- items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
- base::Unretained(this)));
+ items_to_check, "", true,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
@@ -280,8 +282,9 @@ TEST_F(UpdateCheckerTest, UpdateCheckError) {
items_to_check.push_back(&item);
update_checker_->CheckForUpdates(
- items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
- base::Unretained(this)));
+ items_to_check, "", true,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
EXPECT_EQ(1, post_interceptor_->GetHitCount())
@@ -306,7 +309,7 @@ TEST_F(UpdateCheckerTest, UpdateCheckDownloadPreference) {
items_to_check.push_back(&item);
update_checker_->CheckForUpdates(
- items_to_check, "extra=\"params\"",
+ items_to_check, "extra=\"params\"", true,
base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
base::Unretained(this)));
@@ -332,8 +335,9 @@ TEST_F(UpdateCheckerTest, UpdateCheckCupError) {
items_to_check.push_back(&item);
update_checker_->CheckForUpdates(
- items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
- base::Unretained(this)));
+ items_to_check, "", true,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
@@ -370,8 +374,9 @@ TEST_F(UpdateCheckerTest, UpdateCheckRequiresEncryptionError) {
items_to_check.push_back(&item);
update_checker_->CheckForUpdates(
- items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
- base::Unretained(this)));
+ items_to_check, "", true,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
EXPECT_EQ(-1, error_);
@@ -394,13 +399,13 @@ TEST_F(UpdateCheckerTest, UpdateCheckDateLastRollCall) {
// Do two update-checks.
update_checker_->CheckForUpdates(
- items_to_check, "extra=\"params\"",
+ items_to_check, "extra=\"params\"", true,
base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
base::Unretained(this)));
RunThreads();
update_checker_ = UpdateChecker::Create(config_, metadata_.get());
update_checker_->CheckForUpdates(
- items_to_check, "extra=\"params\"",
+ items_to_check, "extra=\"params\"", true,
base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
base::Unretained(this)));
RunThreads();
@@ -430,12 +435,12 @@ TEST_F(UpdateCheckerTest, UpdateCheckUpdateDisabled) {
// Expects the group policy to be ignored and the update check to not
// include the "updatedisabled" attribute.
EXPECT_FALSE(item.component.supports_group_policy_enable_component_updates);
- config_->SetEnabledComponentUpdates(false);
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)));
+ items_to_check, "", false,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
EXPECT_NE(
string::npos,
@@ -448,11 +453,11 @@ TEST_F(UpdateCheckerTest, UpdateCheckUpdateDisabled) {
// * the component updates are disabled.
// Expects the update check to include the "updatedisabled" attribute.
item.component.supports_group_policy_enable_component_updates = true;
- config_->SetEnabledComponentUpdates(false);
update_checker_ = UpdateChecker::Create(config_, metadata_.get());
update_checker_->CheckForUpdates(
- items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
- base::Unretained(this)));
+ items_to_check, "", false,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
EXPECT_NE(
string::npos,
@@ -465,11 +470,11 @@ TEST_F(UpdateCheckerTest, UpdateCheckUpdateDisabled) {
// * the component updates are enabled.
// Expects the update check to not include the "updatedisabled" attribute.
item.component.supports_group_policy_enable_component_updates = false;
- config_->SetEnabledComponentUpdates(true);
update_checker_ = UpdateChecker::Create(config_, metadata_.get());
update_checker_->CheckForUpdates(
- items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
- base::Unretained(this)));
+ items_to_check, "", true,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
EXPECT_NE(
string::npos,
@@ -482,11 +487,11 @@ TEST_F(UpdateCheckerTest, UpdateCheckUpdateDisabled) {
// * the component updates are enabled.
// Expects the update check to not include the "updatedisabled" attribute.
item.component.supports_group_policy_enable_component_updates = true;
- config_->SetEnabledComponentUpdates(true);
update_checker_ = UpdateChecker::Create(config_, metadata_.get());
update_checker_->CheckForUpdates(
- items_to_check, "", base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
- base::Unretained(this)));
+ items_to_check, "", true,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
RunThreads();
EXPECT_NE(
string::npos,
« no previous file with comments | « components/update_client/update_checker.cc ('k') | components/update_client/update_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698