OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_WEBUI_SIGNIN_LOGIN_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_TEST_UTILS_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_TEST_UTILS_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_TEST_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "components/signin/core/browser/signin_metrics.h" |
| 11 |
10 class Browser; | 12 class Browser; |
11 | 13 |
12 namespace login_ui_test_utils { | 14 namespace login_ui_test_utils { |
13 | 15 |
14 // Blocks until the login UI is available and ready for authorization. | 16 // Blocks until the login UI is available and ready for authorization. |
15 void WaitUntilUIReady(Browser* browser); | 17 void WaitUntilUIReady(Browser* browser); |
16 | 18 |
17 // Blocks until an element with id |element_id| exists in the signin page. | 19 // Blocks until an element with id |element_id| exists in the signin page. |
18 void WaitUntilElementExistsInSigninFrame(Browser* browser, | 20 void WaitUntilElementExistsInSigninFrame(Browser* browser, |
19 const std::string& element_id); | 21 const std::string& element_id); |
(...skipping 14 matching lines...) Expand all Loading... |
34 const std::string& email, | 36 const std::string& email, |
35 const std::string& password); | 37 const std::string& password); |
36 | 38 |
37 // Executes JS to sign in the user in the old GAIA sign in flow. | 39 // Executes JS to sign in the user in the old GAIA sign in flow. |
38 void SigninInOldGaiaFlow(Browser* browser, | 40 void SigninInOldGaiaFlow(Browser* browser, |
39 const std::string& email, | 41 const std::string& email, |
40 const std::string& password); | 42 const std::string& password); |
41 | 43 |
42 // A function to sign in a user using Chrome sign-in UI interface. | 44 // A function to sign in a user using Chrome sign-in UI interface. |
43 // This will block until a signin succeeded or failed notification is observed. | 45 // This will block until a signin succeeded or failed notification is observed. |
| 46 // In case |wait_for_account_cookies|, the call will block until the account |
| 47 // cookies have been written to the cookie jar. |
| 48 // |signin_source| identifies the source used to load the signin page. |
| 49 bool SignInWithUI(Browser* browser, |
| 50 const std::string& email, |
| 51 const std::string& password, |
| 52 bool wait_for_account_cookies, |
| 53 signin_metrics::Source signin_source); |
| 54 |
| 55 // Most common way to sign in a user, it does not wait for cookies to be set |
| 56 // and uses the SOURCE_START_PAGE as signin source. |
44 bool SignInWithUI(Browser* browser, | 57 bool SignInWithUI(Browser* browser, |
45 const std::string& email, | 58 const std::string& email, |
46 const std::string& password); | 59 const std::string& password); |
47 | 60 |
48 } // namespace login_ui_test_utils | 61 } // namespace login_ui_test_utils |
49 | 62 |
50 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_TEST_UTILS_H_ | 63 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_TEST_UTILS_H_ |
OLD | NEW |