summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 19:09:41 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 19:09:41 +0000
commit1603c5411a5d640719672ee507cfc0c7ed4e4bca (patch)
tree9edeb7ddd11bee01ad7b5db046641cf2f95052ed /chrome/browser
parent2437226eac22398db557556cbbcd1c3a0578d225 (diff)
downloadchromium_src-1603c5411a5d640719672ee507cfc0c7ed4e4bca.zip
chromium_src-1603c5411a5d640719672ee507cfc0c7ed4e4bca.tar.gz
chromium_src-1603c5411a5d640719672ee507cfc0c7ed4e4bca.tar.bz2
rAc: fix race condition in test
if you don't fake a user name, it might get a username fetch failure at an inopportune moment. BUG=none TEST=waterfall stops flaking R=csharp@google.com Review URL: https://codereview.chromium.org/56033004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc5
-rw-r--r--chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc5
2 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
index 04c75fa..d15e0f4 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
@@ -846,8 +846,7 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, MAYBE_PreservedSections) {
IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest,
GeneratedCardLastFourAfterVerifyCvv) {
- std::vector<std::string> usernames;
- usernames.push_back("user@example.com");
+ std::vector<std::string> usernames(1, "user@example.com");
controller()->OnUserNameFetchSuccess(usernames);
controller()->OnDidFetchWalletCookieValue(std::string());
@@ -914,6 +913,8 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, SignInNoCrash) {
content::NotificationService::AllSources());
controller()->SignInLinkClicked();
+ std::vector<std::string> usernames(1, "user@example.com");
+ controller()->OnUserNameFetchSuccess(usernames);
controller()->OnDidFetchWalletCookieValue(std::string());
controller()->OnDidGetWalletItems(
wallet::GetTestWalletItemsWithRequiredAction(wallet::GAIA_AUTH));
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index f2b7cc8..a1a0356 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -1000,9 +1000,12 @@ void AutofillDialogControllerImpl::SignedInStateUpdated() {
switch (SignedInState()) {
case SIGNED_IN:
+ // If we are already fetching the username, then just keep waiting.
+ if (username_fetcher_.get())
+ break;
+
// Start fetching the user name if we don't know it yet.
if (!account_chooser_model_.HasAccountsToChoose()) {
- DCHECK(!username_fetcher_);
username_fetcher_.reset(new wallet::WalletSigninHelper(
this, profile_->GetRequestContext()));
username_fetcher_->StartUserNameFetch();