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

Unified Diff: chrome/browser/chromeos/login/login_manager_test.h

Issue 270563002: Componentize LoginManagerTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move parameter from ctor to fn 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 side-by-side diff with in-line comments
Download patch
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
deleted file mode 100644
index b05db4860117f540bd8352dd53724d9c9200b554..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/login_manager_test.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_
-#define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_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"
-
-namespace content {
-class WebContents;
-} // namespace content
-
-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
-// out-of-box as completed.
-// Guarantees that WebUI has been initialized by waiting for
-// NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE notification.
-class LoginManagerTest : public InProcessBrowserTest {
- public:
- explicit LoginManagerTest(bool should_launch_browser);
-
- // Overriden from InProcessBrowserTest.
- virtual void CleanUpOnMainThread() OVERRIDE;
- virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE;
- virtual void SetUpInProcessBrowserTestFixture() OVERRIDE;
- virtual void SetUpOnMainThread() OVERRIDE;
-
- // Registers user with given |username| on device.
- // Should be called in PRE_* test.
- // TODO(dzhioev): add ability to register users without PRE_* test.
- void RegisterUser(const std::string& username);
-
- // Set 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
- // 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.
- bool AddUserTosession(const std::string& username,
- const std::string& password);
-
- // Login user with |username|. User should be registered using RegisterUser().
- void LoginUser(const std::string& username);
-
- // Add 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_; }
-
- content::WebContents* web_contents() { return web_contents_; }
-
- private:
- void InitializeWebContents();
-
- void set_web_contents(content::WebContents* web_contents) {
- web_contents_ = web_contents;
- }
-
- MockLoginUtils* mock_login_utils_;
- bool should_launch_browser_;
- content::WebContents* web_contents_;
- test::JSChecker js_checker_;
-
- DISALLOW_COPY_AND_ASSIGN(LoginManagerTest);
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_

Powered by Google App Engine
This is Rietveld 408576698