AU: coalesce interactive / user-initiated flags
The latter was introduced recently but turns out it just carries
a duplicate meaning to the former, so we're eliminating it. This also
makes the case of a simulated scheduled update check more accurate, as
all of the effects of a scheduled update are made.
BUG=None
TEST=Unit tests; interactive/scheduled update check behaves as expected.
Change-Id: I8971aefcfc15cb76733059860832507e88795883
Reviewed-on: https://gerrit.chromium.org/gerrit/41082
Commit-Queue: Gilad Arnold <[email protected]>
Reviewed-by: Gilad Arnold <[email protected]>
Tested-by: Gilad Arnold <[email protected]>
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index 18bcb67..39ad109 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -373,7 +373,7 @@
}
EXPECT_CALL(*processor_, StartProcessing()).Times(1);
- attempter_.Update("", "", false, false, false, false);
+ attempter_.Update("", "", false, false, false);
g_idle_add(&StaticUpdateTestVerify, this);
}
@@ -474,7 +474,7 @@
SetArgumentPointee<0>(std::string("canary-channel")),
Return(true)));
- attempter_.Update("", "", false, false, false, false);
+ attempter_.Update("", "", false, false, false);
EXPECT_EQ("canary-channel", attempter_.omaha_request_params_.app_track);
g_idle_add(&StaticQuitMainLoop, this);
@@ -502,7 +502,7 @@
SetArgumentPointee<0>(true),
Return(true)));
- attempter_.Update("", "", false, false, false, false);
+ attempter_.Update("", "", false, false, false);
EXPECT_TRUE(attempter_.omaha_request_params_.update_disabled);
g_idle_add(&StaticQuitMainLoop, this);
@@ -532,7 +532,7 @@
SetArgumentPointee<0>(target_version_prefix),
Return(true)));
- attempter_.Update("", "", false, false, false, false);
+ attempter_.Update("", "", false, false, false);
EXPECT_EQ(target_version_prefix.c_str(),
attempter_.omaha_request_params_.target_version_prefix);
@@ -565,7 +565,7 @@
SetArgumentPointee<0>(scatter_factor_in_seconds),
Return(true)));
- attempter_.Update("", "", false, false, false, false);
+ attempter_.Update("", "", false, false, false);
EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds());
g_idle_add(&StaticQuitMainLoop, this);
@@ -612,7 +612,7 @@
SetArgumentPointee<0>(scatter_factor_in_seconds),
Return(true)));
- attempter_.Update("", "", false, false, false, false);
+ attempter_.Update("", "", false, false, false);
EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds());
// Make sure the file still exists.
@@ -627,7 +627,7 @@
// However, if the count is already 0, it's not decremented. Test that.
initial_value = 0;
EXPECT_TRUE(prefs.SetInt64(kPrefsUpdateCheckCount, initial_value));
- attempter_.Update("", "", false, false, false, false);
+ attempter_.Update("", "", false, false, false);
EXPECT_TRUE(prefs.Exists(kPrefsUpdateCheckCount));
EXPECT_TRUE(prefs.GetInt64(kPrefsUpdateCheckCount, &new_value));
EXPECT_EQ(initial_value, new_value);
@@ -679,9 +679,8 @@
SetArgumentPointee<0>(scatter_factor_in_seconds),
Return(true)));
- // pass true for is_user_initiated so we can test that the
- // scattering is disabled.
- attempter_.Update("", "", false, false, false, true);
+ // Trigger an interactive check so we can test that scattering is disabled.
+ attempter_.Update("", "", false, true, false);
EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds());
// Make sure scattering is disabled for manual (i.e. user initiated) update