Index: chrome/browser/chromeos/login/login_manager_test.h |
diff --git a/chrome/browser/chromeos/login/login_manager_test.h b/chrome/browser/chromeos/login/login_manager_test.h |
index c080189c21f51c0d238ec6e81076d8cce8f27f72..66c7a995876f55ff52f7ab95bddd2aafdd317cd2 100644 |
--- a/chrome/browser/chromeos/login/login_manager_test.h |
+++ b/chrome/browser/chromeos/login/login_manager_test.h |
@@ -7,6 +7,8 @@ |
#include <string> |
+#include "base/memory/scoped_ptr.h" |
+#include "chrome/browser/chromeos/login/login_manager_test_helper.h" |
#include "chrome/browser/chromeos/login/mock_login_utils.h" |
#include "chrome/browser/chromeos/login/test/js_checker.h" |
#include "chrome/test/base/in_process_browser_test.h" |
@@ -19,13 +21,14 @@ namespace chromeos { |
// Base class for Chrome OS out-of-box/login WebUI tests. |
// If no special configuration is done launches out-of-box WebUI. |
-// To launch login UI use PRE_* test that will register user(s) and mark |
+// To launch login UI use a PRE_* test that will register user(s) and mark |
// out-of-box as completed. |
-// Guarantees that WebUI has been initialized by waiting for |
-// NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE notification. |
+// Uses LoginManagerTestHelper to set up login utils and ensure WebUI has been |
+// initialized. |
class LoginManagerTest : public InProcessBrowserTest { |
public: |
explicit LoginManagerTest(bool should_launch_browser); |
+ virtual ~LoginManagerTest(); |
// Overriden from InProcessBrowserTest. |
virtual void CleanUpOnMainThread() OVERRIDE; |
@@ -38,31 +41,32 @@ class LoginManagerTest : public InProcessBrowserTest { |
// TODO(dzhioev): add ability to register users without PRE_* test. |
void RegisterUser(const std::string& username); |
- // Set expected credentials for next login attempt. |
+ // Sets expected credentials for next login attempt. |
void SetExpectedCredentials(const std::string& username, |
const std::string& password); |
- // Tries to login with |username| and |password|. Returns false if attempt |
+ // Tries to log in with |username| and |password|. Returns false if attempt |
// has failed. |
bool TryToLogin(const std::string& username, const std::string& password); |
// Tries to add user to session with |username| and |password|. Returns false |
- // if attempt has failed. this function does the same as TryToLogin but |
- // doesn't check that new user become active user. |
+ // if attempt has failed. This function does the same as TryToLogin but |
+ // doesn't check that the new user became the active user. |
bool AddUserToSession(const std::string& username, |
const std::string& password); |
- // Login user with |username|. User should be registered using RegisterUser(). |
+ // Logs in user with |username|. User should be registered using |
+ // RegisterUser(). |
void LoginUser(const std::string& username); |
- // Add user with |username| to session. |
+ // Adds user with |username| to session. |
void AddUser(const std::string& username); |
// Executes given JS |expression| in |web_contents_| and checks |
// that it is true. |
void JSExpect(const std::string& expression); |
- MockLoginUtils& login_utils() { return *mock_login_utils_; } |
+ MockLoginUtils& login_utils(); |
content::WebContents* web_contents() { return web_contents_; } |
@@ -74,6 +78,7 @@ class LoginManagerTest : public InProcessBrowserTest { |
} |
MockLoginUtils* mock_login_utils_; |
+ scoped_ptr<LoginManagerTestHelper> login_manager_test_helper_; |
bool should_launch_browser_; |
content::WebContents* web_contents_; |
test::JSChecker js_checker_; |