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

Side by Side Diff: chrome/browser/signin/signin_browsertest.cc

Issue 12929014: Identity API: Pop-up a sign-in dialog if gaia credentials are bad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: fix signin browser test for chromeos Created 7 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_ 5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_
6 #define CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_ 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_
7 7
8 #include "chrome/browser/signin/signin_manager.h" 8 #include "chrome/browser/signin/signin_manager.h"
9 #include "chrome/browser/signin/signin_manager_factory.h" 9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/singleton_tabs.h"
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" 12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
12 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 13 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
13 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 14 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
14 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" 15 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
15 #include "chrome/common/url_constants.h" 16 #include "chrome/common/url_constants.h"
16 #include "chrome/test/base/in_process_browser_test.h" 17 #include "chrome/test/base/in_process_browser_test.h"
17 #include "chrome/test/base/ui_test_utils.h" 18 #include "chrome/test/base/ui_test_utils.h"
18 #include "content/public/browser/render_process_host.h" 19 #include "content/public/browser/render_process_host.h"
19 #include "content/public/browser/render_view_host.h" 20 #include "content/public/browser/render_view_host.h"
20 #include "content/public/browser/web_contents.h" 21 #include "content/public/browser/web_contents.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 content::WebContents* active_tab = 85 content::WebContents* active_tab =
85 browser()->tab_strip_model()->GetActiveWebContents(); 86 browser()->tab_strip_model()->GetActiveWebContents();
86 int active_tab_process_id = 87 int active_tab_process_id =
87 active_tab->GetRenderProcessHost()->GetID(); 88 active_tab->GetRenderProcessHost()->GetID();
88 EXPECT_EQ(kOneClickSigninEnabled, 89 EXPECT_EQ(kOneClickSigninEnabled,
89 signin->IsSigninProcess(active_tab_process_id)); 90 signin->IsSigninProcess(active_tab_process_id));
90 EXPECT_EQ(0, active_tab->GetRenderViewHost()->GetEnabledBindings()); 91 EXPECT_EQ(0, active_tab->GetRenderViewHost()->GetEnabledBindings());
91 92
92 // Entry points to signin request "SINGLETON_TAB" mode, so a new request 93 // Entry points to signin request "SINGLETON_TAB" mode, so a new request
93 // shouldn't change anything. 94 // shouldn't change anything.
94 LoginUIService* login = LoginUIServiceFactory::GetForProfile( 95 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams(
95 browser()->profile()); 96 browser(),
96 login->ShowLoginPopup(); 97 GURL(SyncPromoUI::GetSyncPromoURL(GURL(),
98 SyncPromoUI::SOURCE_NTP_LINK,
99 false))));
100 params.path_behavior = chrome::NavigateParams::IGNORE_AND_NAVIGATE;
101 ShowSingletonTabOverwritingNTP(browser(), params);
97 EXPECT_EQ(active_tab, browser()->tab_strip_model()->GetActiveWebContents()); 102 EXPECT_EQ(active_tab, browser()->tab_strip_model()->GetActiveWebContents());
98 EXPECT_EQ(kOneClickSigninEnabled, 103 EXPECT_EQ(kOneClickSigninEnabled,
99 signin->IsSigninProcess(active_tab_process_id)); 104 signin->IsSigninProcess(active_tab_process_id));
100 105
101 // Navigating away should change the process. 106 // Navigating away should change the process.
102 ui_test_utils::NavigateToURL(browser(), GURL(kNonSigninURL)); 107 ui_test_utils::NavigateToURL(browser(), GURL(kNonSigninURL));
103 EXPECT_FALSE(signin->IsSigninProcess( 108 EXPECT_FALSE(signin->IsSigninProcess(
104 active_tab->GetRenderProcessHost()->GetID())); 109 active_tab->GetRenderProcessHost()->GetID()));
105 } 110 }
106 111
107 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_ 112 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_signin_flow.cc ('k') | chrome/browser/ui/webui/signin/login_ui_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698