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

Unified Diff: chrome/browser/google/google_update_win_unittest.cc

Issue 2069263002: Fix retry when GU reports APP_USING_EXTERNAL_UPDATER. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
Index: chrome/browser/google/google_update_win_unittest.cc
diff --git a/chrome/browser/google/google_update_win_unittest.cc b/chrome/browser/google/google_update_win_unittest.cc
index 5bbe4b730d4fc9f93125d8c0d2c4bc581014c54b..325a634f0ccf4eaef9dc21b9105b6a7f5e3cb543 100644
--- a/chrome/browser/google/google_update_win_unittest.cc
+++ b/chrome/browser/google/google_update_win_unittest.cc
@@ -914,40 +914,36 @@ TEST_P(GoogleUpdateWinTest, UpdateFailed) {
TEST_P(GoogleUpdateWinTest, RetryAfterExternalUpdaterError) {
static const HRESULT GOOPDATE_E_APP_USING_EXTERNAL_UPDATER = 0xa043081d;
- CComObject<MockAppBundle>* mock_app_bundle1 =
+ CComObject<MockAppBundle>* mock_app_bundle =
mock_google_update_factory_.MakeServerMock()->MakeAppBundle();
// The first attempt will fail in createInstalledApp indicating that an update
// is already in progress.
- EXPECT_CALL(*mock_app_bundle1, createInstalledApp(StrEq(kChromeBinariesGuid)))
+ Sequence bundle_seq;
+ EXPECT_CALL(*mock_app_bundle, createInstalledApp(StrEq(kChromeBinariesGuid)))
+ .InSequence(bundle_seq)
.WillOnce(Return(GOOPDATE_E_APP_USING_EXTERNAL_UPDATER));
- // Retry with a second instance.
- CComObject<MockAppBundle>* mock_app_bundle2 = nullptr;
+ // Expect a retry on the same instance.
+ EXPECT_CALL(*mock_app_bundle, createInstalledApp(StrEq(kChromeBinariesGuid)))
+ .InSequence(bundle_seq)
+ .WillOnce(Return(S_OK));
+
+ // See MakeApp() for an explanation of this:
CComObject<MockApp>* mock_app = nullptr;
- MakeGoogleUpdateMocks(&mock_app_bundle2, &mock_app);
+ EXPECT_EQ(S_OK, CComObject<MockApp>::CreateInstance(&mock_app));
+ mock_app->AddRef();
+ EXPECT_CALL(*mock_app_bundle, get_appWeb(0, _))
+ .WillOnce(DoAll(SetArgPointee<1>(mock_app), Return(S_OK)));
// Expect the bundle to be called on to start the update.
- EXPECT_CALL(*mock_app_bundle2, checkForUpdate())
- .WillOnce(Return(S_OK));
+ EXPECT_CALL(*mock_app_bundle, checkForUpdate()).WillOnce(Return(S_OK));
mock_app->PushState(STATE_INIT);
mock_app->PushState(STATE_CHECKING_FOR_UPDATE);
mock_app->PushState(STATE_NO_UPDATE);
- // Until http://crbug.com/504516 is fixed, we expect the first update check
- // to fail.
- EXPECT_CALL(mock_update_check_delegate_,
- OnError(GOOGLE_UPDATE_ONDEMAND_CLASS_REPORTED_ERROR, _, _));
-
- // Run the first update check. When http://crbug.com/504516 is fixed, this
- // update check will be subsumed in the one below.
- BeginUpdateCheck(task_runner_, std::string(), true, 0,
- mock_update_check_delegate_.AsWeakPtr());
- task_runner_->RunUntilIdle();
-
- // Expect a second update check to succeed. When http://crbug.com/504516 is
- // fixed, this will be the one and only update check.
+ // Expect the update check to succeed.
EXPECT_CALL(mock_update_check_delegate_,
OnUpdateCheckComplete(IsEmpty())); // new_version
BeginUpdateCheck(task_runner_, std::string(), false, 0,
« chrome/browser/google/google_update_win.cc ('K') | « chrome/browser/google/google_update_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698