| OLD | NEW |
| 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_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/chromeos/login/mock_login_utils.h" | 8 #include "chrome/browser/chromeos/login/mock_login_utils.h" |
| 9 #include "chrome/browser/chromeos/login/test/js_checker.h" | 9 #include "chrome/browser/chromeos/login/test/js_checker.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class WebContents; | 13 class WebContents; |
| 14 } // namespace content | 14 } // namespace content |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 | 17 |
| 18 // Base class for Chrome OS out-of-box/login WebUI tests. | 18 // Base class for Chrome OS out-of-box/login WebUI tests. |
| 19 // If no special configuration is done launches out-of-box WebUI. | 19 // If no special configuration is done launches out-of-box WebUI. |
| 20 // To launch login UI use PRE_* test that will register user(s) and mark | 20 // To launch login UI use PRE_* test that will register user(s) and mark |
| 21 // out-of-box as completed. | 21 // out-of-box as completed. |
| 22 // Guarantees that WebUI has been initialized by waiting for | 22 // Guarantees that WebUI has been initialized by waiting for |
| 23 // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE notification. | 23 // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE notification. |
| 24 class LoginManagerTest : public InProcessBrowserTest { | 24 class LoginManagerTest : public InProcessBrowserTest { |
| 25 public: | 25 public: |
| 26 explicit LoginManagerTest(bool should_launch_browser); | 26 explicit LoginManagerTest(bool should_launch_browser); |
| 27 | 27 |
| 28 // Overriden from InProcessBrowserTest. | 28 // Overriden from InProcessBrowserTest. |
| 29 virtual void CleanUpOnMainThread() OVERRIDE; | 29 virtual void CleanUpOnMainThread() OVERRIDE; |
| 30 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 30 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
| 31 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 31 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
| 32 virtual void SetUpOnMainThread() OVERRIDE; | 32 virtual void SetUpOnMainThread() OVERRIDE; |
| 33 | 33 |
| 34 // Registers user with given |username| on device. | 34 // Registers user with given |username| on device. |
| 35 // Should be called in PRE_* test. | 35 // Should be called in PRE_* test. |
| 36 // TODO(dzhioev): add ability to register users without PRE_* test. | 36 // TODO(dzhioev): add ability to register users without PRE_* test. |
| 37 void RegisterUser(const std::string& username); | 37 void RegisterUser(const std::string& username); |
| 38 | 38 |
| 39 // Set expected credentials for next login attempt. | 39 // Set expected credentials for next login attempt. |
| 40 void SetExpectedCredentials(const std::string& username, | 40 void SetExpectedCredentials(const std::string& username, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 bool should_launch_browser_; | 75 bool should_launch_browser_; |
| 76 content::WebContents* web_contents_; | 76 content::WebContents* web_contents_; |
| 77 test::JSChecker js_checker_; | 77 test::JSChecker js_checker_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(LoginManagerTest); | 79 DISALLOW_COPY_AND_ASSIGN(LoginManagerTest); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace chromeos | 82 } // namespace chromeos |
| 83 | 83 |
| 84 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_ | 84 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_ |
| OLD | NEW |