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 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h" | 5 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 void WebUIScreenLockerTester::EnterPassword(const std::string& password) { | 138 void WebUIScreenLockerTester::EnterPassword(const std::string& password) { |
139 bool result; | 139 bool result; |
140 SetPassword(password); | 140 SetPassword(password); |
141 | 141 |
142 // Verify password is set. | 142 // Verify password is set. |
143 ASSERT_EQ(password, GetPassword()); | 143 ASSERT_EQ(password, GetPassword()); |
144 | 144 |
145 // Verify that "signin" button is hidden. | 145 // Verify that "signin" button is hidden. |
146 scoped_ptr<base::Value> v = content::ExecuteScriptAndGetValue( | 146 scoped_ptr<base::Value> v = content::ExecuteScriptAndGetValue( |
147 RenderViewHost()->GetMainFrame(), | 147 RenderViewHost()->GetMainFrame(), |
148 "$('pod-row').pods[0].signinButtonElement.hidden;"); | 148 "window.getComputedStyle(" |
| 149 " $('pod-row').pods[0].querySelector('.signin-button-container'))" |
| 150 " .display == 'none'"); |
149 ASSERT_TRUE(v->GetAsBoolean(&result)); | 151 ASSERT_TRUE(v->GetAsBoolean(&result)); |
150 ASSERT_TRUE(result); | 152 ASSERT_TRUE(result); |
151 | 153 |
152 // Attempt to sign in. | 154 // Attempt to sign in. |
153 LoginAttemptObserver login; | 155 LoginAttemptObserver login; |
154 v = content::ExecuteScriptAndGetValue( | 156 v = content::ExecuteScriptAndGetValue( |
155 RenderViewHost()->GetMainFrame(), | 157 RenderViewHost()->GetMainFrame(), |
156 "$('pod-row').pods[0].activate();"); | 158 "$('pod-row').pods[0].activate();"); |
157 ASSERT_TRUE(v->GetAsBoolean(&result)); | 159 ASSERT_TRUE(v->GetAsBoolean(&result)); |
158 ASSERT_TRUE(result); | 160 ASSERT_TRUE(result); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 new MockAuthenticator(ScreenLocker::screen_locker_, user_context)); | 209 new MockAuthenticator(ScreenLocker::screen_locker_, user_context)); |
208 } | 210 } |
209 | 211 |
210 } // namespace test | 212 } // namespace test |
211 | 213 |
212 test::ScreenLockerTester* ScreenLocker::GetTester() { | 214 test::ScreenLockerTester* ScreenLocker::GetTester() { |
213 return new test::WebUIScreenLockerTester(); | 215 return new test::WebUIScreenLockerTester(); |
214 } | 216 } |
215 | 217 |
216 } // namespace chromeos | 218 } // namespace chromeos |
OLD | NEW |