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 <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/chromeos/login/mixin_based_browser_test.h" | 10 #include "chrome/browser/chromeos/login/mixin_based_browser_test.h" |
11 #include "chrome/browser/chromeos/login/mock_login_utils.h" | |
12 #include "chrome/browser/chromeos/login/test/js_checker.h" | 11 #include "chrome/browser/chromeos/login/test/js_checker.h" |
13 | 12 |
14 namespace content { | 13 namespace content { |
15 class WebContents; | 14 class WebContents; |
16 } // namespace content | 15 } // namespace content |
17 | 16 |
18 namespace chromeos { | 17 namespace chromeos { |
19 | 18 |
20 class UserContext; | 19 class UserContext; |
21 | 20 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Log in user with |user_id|. User should be registered using RegisterUser(). | 55 // Log in user with |user_id|. User should be registered using RegisterUser(). |
57 void LoginUser(const std::string& user_id); | 56 void LoginUser(const std::string& user_id); |
58 | 57 |
59 // Add user with |user_id| to session. | 58 // Add user with |user_id| to session. |
60 void AddUser(const std::string& user_id); | 59 void AddUser(const std::string& user_id); |
61 | 60 |
62 // Executes given JS |expression| in |web_contents_| and checks | 61 // Executes given JS |expression| in |web_contents_| and checks |
63 // that it is true. | 62 // that it is true. |
64 void JSExpect(const std::string& expression); | 63 void JSExpect(const std::string& expression); |
65 | 64 |
66 MockLoginUtils& login_utils() { return *mock_login_utils_; } | |
67 | |
68 content::WebContents* web_contents() { return web_contents_; } | 65 content::WebContents* web_contents() { return web_contents_; } |
69 | 66 |
70 test::JSChecker& js_checker() { return js_checker_; } | 67 test::JSChecker& js_checker() { return js_checker_; } |
71 | 68 |
72 private: | 69 private: |
73 void InitializeWebContents(); | 70 void InitializeWebContents(); |
74 | 71 |
75 void set_web_contents(content::WebContents* web_contents) { | 72 void set_web_contents(content::WebContents* web_contents) { |
76 web_contents_ = web_contents; | 73 web_contents_ = web_contents; |
77 } | 74 } |
78 | 75 |
79 MockLoginUtils* mock_login_utils_; | |
80 bool should_launch_browser_; | 76 bool should_launch_browser_; |
81 content::WebContents* web_contents_; | 77 content::WebContents* web_contents_; |
82 test::JSChecker js_checker_; | 78 test::JSChecker js_checker_; |
83 | 79 |
84 DISALLOW_COPY_AND_ASSIGN(LoginManagerTest); | 80 DISALLOW_COPY_AND_ASSIGN(LoginManagerTest); |
85 }; | 81 }; |
86 | 82 |
87 } // namespace chromeos | 83 } // namespace chromeos |
88 | 84 |
89 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_ | 85 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_MANAGER_TEST_H_ |
OLD | NEW |