Index: chrome/browser/ui/sync/one_click_signin_helper.h |
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.h b/chrome/browser/ui/sync/one_click_signin_helper.h |
index 0d3e96e1854b2de6c8fa8d47b29fe8a1e5fe17a2..8bd48c0e183043766d2841edb2bb6d20f3822012 100644 |
--- a/chrome/browser/ui/sync/one_click_signin_helper.h |
+++ b/chrome/browser/ui/sync/one_click_signin_helper.h |
@@ -196,6 +196,12 @@ class OneClickSigninHelper |
// Clear all data member of the helper, except for the error. |
void CleanTransientState(); |
+ // Unitests that use a TestingProfile should call this. |
+ // Otherwise, clearing the pending e-mail crashes because the code expects |
+ // a real ResourceContext rather than the MockResourceContext a |
+ // TestingProfile provides. |
+ void SetDoNotClearPendingEmailForTesting(); |
+ |
// Grab Gaia password if available. |
bool OnFormSubmitted(const content::PasswordForm& form); |
@@ -242,6 +248,10 @@ class OneClickSigninHelper |
// This is set to true if at least one such URL is detected. |
bool untrusted_confirmation_required_; |
+ // Allows unittests to avoid accessing the ResourceContext for clearing a |
+ // pending e-mail. |
+ bool do_not_clear_pending_email_; |
+ |
DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); |
}; |