| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 7 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 8 #include "chrome/browser/password_manager/password_manager_test_base.h" | 8 #include "chrome/browser/password_manager/password_manager_test_base.h" |
| 9 #include "chrome/browser/password_manager/password_store_factory.h" | 9 #include "chrome/browser/password_manager/password_store_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 RenderViewHost(), | 115 RenderViewHost(), |
| 116 "document.getElementById('password_field').focus()")); | 116 "document.getElementById('password_field').focus()")); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void SendKeyToPopup(ui::KeyboardCode key) { | 119 void SendKeyToPopup(ui::KeyboardCode key) { |
| 120 content::NativeWebKeyboardEvent event( | 120 content::NativeWebKeyboardEvent event( |
| 121 blink::WebKeyboardEvent::kRawKeyDown, | 121 blink::WebKeyboardEvent::kRawKeyDown, |
| 122 blink::WebInputEvent::kNoModifiers, | 122 blink::WebInputEvent::kNoModifiers, |
| 123 blink::WebInputEvent::kTimeStampForTesting); | 123 blink::WebInputEvent::kTimeStampForTesting); |
| 124 event.windows_key_code = key; | 124 event.windows_key_code = key; |
| 125 RenderViewHost()->GetWidget()->ForwardKeyboardEvent(event); | 125 RenderViewHost()->GetWidget()->ForwardKeyboardEventWithLatencyInfo( |
| 126 event, ui::LatencyInfo()); |
| 126 } | 127 } |
| 127 | 128 |
| 128 bool GenerationPopupShowing() { | 129 bool GenerationPopupShowing() { |
| 129 return observer_.popup_showing() && observer_.password_visible(); | 130 return observer_.popup_showing() && observer_.password_visible(); |
| 130 } | 131 } |
| 131 | 132 |
| 132 bool EditingPopupShowing() { | 133 bool EditingPopupShowing() { |
| 133 return observer_.popup_showing() && !observer_.password_visible(); | 134 return observer_.popup_showing() && !observer_.password_visible(); |
| 134 } | 135 } |
| 135 | 136 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 EXPECT_FALSE(password_store->IsEmpty()); | 224 EXPECT_FALSE(password_store->IsEmpty()); |
| 224 | 225 |
| 225 // Make sure the username is correct. | 226 // Make sure the username is correct. |
| 226 password_manager::TestPasswordStore::PasswordMap stored_passwords = | 227 password_manager::TestPasswordStore::PasswordMap stored_passwords = |
| 227 password_store->stored_passwords(); | 228 password_store->stored_passwords(); |
| 228 EXPECT_EQ(1u, stored_passwords.size()); | 229 EXPECT_EQ(1u, stored_passwords.size()); |
| 229 EXPECT_EQ(1u, stored_passwords.begin()->second.size()); | 230 EXPECT_EQ(1u, stored_passwords.begin()->second.size()); |
| 230 EXPECT_EQ(base::UTF8ToUTF16("something"), | 231 EXPECT_EQ(base::UTF8ToUTF16("something"), |
| 231 (stored_passwords.begin()->second)[0].username_value); | 232 (stored_passwords.begin()->second)[0].username_value); |
| 232 } | 233 } |
| OLD | NEW |