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

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

Issue 296703011: Change refs from ChromeSigninClient to base SigninClient class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small tweak on signin_client.h Created 6 years, 7 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 "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/browser/signin/chrome_signin_client.h" 9 #include "chrome/browser/signin/chrome_signin_client.h"
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" 10 #include "chrome/browser/signin/chrome_signin_client_factory.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const bool kOneClickSigninEnabled = false; 100 const bool kOneClickSigninEnabled = false;
101 #endif 101 #endif
102 102
103 // Disabled on Windows due to flakiness. http://crbug.com/249055 103 // Disabled on Windows due to flakiness. http://crbug.com/249055
104 #if defined(OS_WIN) 104 #if defined(OS_WIN)
105 #define MAYBE_ProcessIsolation DISABLED_ProcessIsolation 105 #define MAYBE_ProcessIsolation DISABLED_ProcessIsolation
106 #else 106 #else
107 #define MAYBE_ProcessIsolation ProcessIsolation 107 #define MAYBE_ProcessIsolation ProcessIsolation
108 #endif 108 #endif
109 IN_PROC_BROWSER_TEST_F(SigninBrowserTest, MAYBE_ProcessIsolation) { 109 IN_PROC_BROWSER_TEST_F(SigninBrowserTest, MAYBE_ProcessIsolation) {
110 ChromeSigninClient* signin = 110 SigninClient* signin =
111 ChromeSigninClientFactory::GetForProfile(browser()->profile()); 111 ChromeSigninClientFactory::GetForProfile(browser()->profile());
112 EXPECT_FALSE(signin->HasSigninProcess()); 112 EXPECT_FALSE(signin->HasSigninProcess());
113 113
114 ui_test_utils::NavigateToURL(browser(), signin::GetPromoURL( 114 ui_test_utils::NavigateToURL(browser(), signin::GetPromoURL(
115 signin::SOURCE_NTP_LINK, true)); 115 signin::SOURCE_NTP_LINK, true));
116 EXPECT_EQ(kOneClickSigninEnabled, signin->HasSigninProcess()); 116 EXPECT_EQ(kOneClickSigninEnabled, signin->HasSigninProcess());
117 117
118 // Navigating away should change the process. 118 // Navigating away should change the process.
119 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIOmniboxURL)); 119 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIOmniboxURL));
120 EXPECT_FALSE(signin->HasSigninProcess()); 120 EXPECT_FALSE(signin->HasSigninProcess());
(...skipping 21 matching lines...) Expand all
142 EXPECT_EQ(kOneClickSigninEnabled, 142 EXPECT_EQ(kOneClickSigninEnabled,
143 signin->IsSigninProcess(active_tab_process_id)); 143 signin->IsSigninProcess(active_tab_process_id));
144 144
145 // Navigating away should change the process. 145 // Navigating away should change the process.
146 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); 146 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL));
147 EXPECT_FALSE(signin->IsSigninProcess( 147 EXPECT_FALSE(signin->IsSigninProcess(
148 active_tab->GetRenderProcessHost()->GetID())); 148 active_tab->GetRenderProcessHost()->GetID()));
149 } 149 }
150 150
151 IN_PROC_BROWSER_TEST_F(SigninBrowserTest, NotTrustedAfterRedirect) { 151 IN_PROC_BROWSER_TEST_F(SigninBrowserTest, NotTrustedAfterRedirect) {
152 ChromeSigninClient* signin = 152 SigninClient* signin =
153 ChromeSigninClientFactory::GetForProfile(browser()->profile()); 153 ChromeSigninClientFactory::GetForProfile(browser()->profile());
154 EXPECT_FALSE(signin->HasSigninProcess()); 154 EXPECT_FALSE(signin->HasSigninProcess());
155 155
156 GURL url = signin::GetPromoURL(signin::SOURCE_NTP_LINK, true); 156 GURL url = signin::GetPromoURL(signin::SOURCE_NTP_LINK, true);
157 ui_test_utils::NavigateToURL(browser(), url); 157 ui_test_utils::NavigateToURL(browser(), url);
158 EXPECT_EQ(kOneClickSigninEnabled, signin->HasSigninProcess()); 158 EXPECT_EQ(kOneClickSigninEnabled, signin->HasSigninProcess());
159 159
160 // Navigating in a different tab should not affect the sign-in process. 160 // Navigating in a different tab should not affect the sign-in process.
161 ui_test_utils::NavigateToURLWithDisposition( 161 ui_test_utils::NavigateToURLWithDisposition(
162 browser(), GURL(kNonSigninURL), NEW_BACKGROUND_TAB, 162 browser(), GURL(kNonSigninURL), NEW_BACKGROUND_TAB,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 // This is a test for http://crbug.com/257277. It simulates the navigations 200 // This is a test for http://crbug.com/257277. It simulates the navigations
201 // that occur if the user clicks on the "Skip for now" link at the signin page 201 // that occur if the user clicks on the "Skip for now" link at the signin page
202 // and initiates a back navigation between the point of Commit and 202 // and initiates a back navigation between the point of Commit and
203 // DidStopLoading of the NTP. 203 // DidStopLoading of the NTP.
204 IN_PROC_BROWSER_TEST_F(SigninBrowserTest, SigninSkipForNowAndGoBack) { 204 IN_PROC_BROWSER_TEST_F(SigninBrowserTest, SigninSkipForNowAndGoBack) {
205 GURL ntp_url(chrome::kChromeUINewTabURL); 205 GURL ntp_url(chrome::kChromeUINewTabURL);
206 GURL start_url = signin::GetPromoURL(signin::SOURCE_START_PAGE, false); 206 GURL start_url = signin::GetPromoURL(signin::SOURCE_START_PAGE, false);
207 GURL skip_url = signin::GetLandingURL("ntp", 1); 207 GURL skip_url = signin::GetLandingURL("ntp", 1);
208 208
209 ChromeSigninClient* signin = 209 SigninClient* signin =
210 ChromeSigninClientFactory::GetForProfile(browser()->profile()); 210 ChromeSigninClientFactory::GetForProfile(browser()->profile());
211 EXPECT_FALSE(signin->HasSigninProcess()); 211 EXPECT_FALSE(signin->HasSigninProcess());
212 212
213 ui_test_utils::NavigateToURL(browser(), start_url); 213 ui_test_utils::NavigateToURL(browser(), start_url);
214 EXPECT_EQ(kOneClickSigninEnabled, signin->HasSigninProcess()); 214 EXPECT_EQ(kOneClickSigninEnabled, signin->HasSigninProcess());
215 215
216 content::WebContents* web_contents = 216 content::WebContents* web_contents =
217 browser()->tab_strip_model()->GetActiveWebContents(); 217 browser()->tab_strip_model()->GetActiveWebContents();
218 218
219 // Simulate clicking on the Skip for now link. It's important to have a 219 // Simulate clicking on the Skip for now link. It's important to have a
(...skipping 17 matching lines...) Expand all
237 EXPECT_EQ(skip_url, web_contents->GetLastCommittedURL()); 237 EXPECT_EQ(skip_url, web_contents->GetLastCommittedURL());
238 EXPECT_EQ(start_url, web_contents->GetVisibleURL()); 238 EXPECT_EQ(start_url, web_contents->GetVisibleURL());
239 239
240 content::WindowedNotificationObserver observer( 240 content::WindowedNotificationObserver observer(
241 content::NOTIFICATION_LOAD_STOP, 241 content::NOTIFICATION_LOAD_STOP,
242 content::NotificationService::AllSources()); 242 content::NotificationService::AllSources());
243 observer.Wait(); 243 observer.Wait();
244 EXPECT_EQ(start_url, web_contents->GetLastCommittedURL()); 244 EXPECT_EQ(start_url, web_contents->GetLastCommittedURL());
245 } 245 }
246 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_ 246 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698