| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return result; | 133 return result; |
| 134 } | 134 } |
| 135 | 135 |
| 136 void WebUIScreenLockerTester::EnterPassword(const std::string& password) { | 136 void WebUIScreenLockerTester::EnterPassword(const std::string& password) { |
| 137 bool result; | 137 bool result; |
| 138 SetPassword(password); | 138 SetPassword(password); |
| 139 | 139 |
| 140 // Verify password is set. | 140 // Verify password is set. |
| 141 ASSERT_EQ(password, GetPassword()); | 141 ASSERT_EQ(password, GetPassword()); |
| 142 | 142 |
| 143 // Verify that "signin" button is hidden. | 143 // Verify that "reauth" warning is hidden. |
| 144 scoped_ptr<base::Value> v = content::ExecuteScriptAndGetValue( | 144 scoped_ptr<base::Value> v = content::ExecuteScriptAndGetValue( |
| 145 RenderViewHost()->GetMainFrame(), | 145 RenderViewHost()->GetMainFrame(), |
| 146 "window.getComputedStyle(" | 146 "window.getComputedStyle(" |
| 147 " $('pod-row').pods[0].querySelector('.signin-button-container'))" | 147 " $('pod-row').pods[0].querySelector('.reauth-hint-container'))" |
| 148 " .display == 'none'"); | 148 " .display == 'none'"); |
| 149 ASSERT_TRUE(v->GetAsBoolean(&result)); | 149 ASSERT_TRUE(v->GetAsBoolean(&result)); |
| 150 ASSERT_TRUE(result); | 150 ASSERT_TRUE(result); |
| 151 | 151 |
| 152 // Attempt to sign in. | 152 // Attempt to sign in. |
| 153 LoginAttemptObserver login; | 153 LoginAttemptObserver login; |
| 154 v = content::ExecuteScriptAndGetValue( | 154 v = content::ExecuteScriptAndGetValue( |
| 155 RenderViewHost()->GetMainFrame(), | 155 RenderViewHost()->GetMainFrame(), |
| 156 "$('pod-row').pods[0].activate();"); | 156 "$('pod-row').pods[0].activate();"); |
| 157 ASSERT_TRUE(v->GetAsBoolean(&result)); | 157 ASSERT_TRUE(v->GetAsBoolean(&result)); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 new FakeExtendedAuthenticator(ScreenLocker::screen_locker_, user_context); | 209 new FakeExtendedAuthenticator(ScreenLocker::screen_locker_, user_context); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace test | 212 } // namespace test |
| 213 | 213 |
| 214 test::ScreenLockerTester* ScreenLocker::GetTester() { | 214 test::ScreenLockerTester* ScreenLocker::GetTester() { |
| 215 return new test::WebUIScreenLockerTester(); | 215 return new test::WebUIScreenLockerTester(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace chromeos | 218 } // namespace chromeos |
| OLD | NEW |