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

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc

Issue 11437014: Fix crash when signing in to gaia from an incognito tab (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo in comments Created 8 years 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 | « chrome/browser/ui/sync/one_click_signin_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
index 4da9628c9b627165c06b0409cd05ca1425319dbd..5b36d0715b018bfb7096e0acd1454c4640b9a52e 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
@@ -26,6 +26,7 @@
#include "chrome/test/base/testing_profile_manager.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_renderer_host.h"
#include "grit/generated_resources.h"
@@ -519,6 +520,21 @@ TEST_F(OneClickSigninHelperTest, CanOfferNoSigninCookies) {
EXPECT_EQ(0, error_message_id);
}
+// Should not crash if a helper instance is not associated with an incognito
+// web contents.
+TEST_F(OneClickSigninHelperTest, ShowInfoBarUIThreadIncognito) {
+ CreateSigninManager(true, "");
+ OneClickSigninHelper* helper =
+ OneClickSigninHelper::FromWebContents(web_contents());
+ EXPECT_EQ(NULL, helper);
+
+ OneClickSigninHelper::ShowInfoBarUIThread("session_index", "email",
+ OneClickSigninHelper::AUTO_ACCEPT,
+ SyncPromoUI::SOURCE_UNKNOWN,
+ process()->GetID(),
+ rvh()->GetRoutingID());
+}
+
// I/O thread tests
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThread) {
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698