Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/password_manager/password_generation_interactive_uitest.cc

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: Fix test issue Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 ASSERT_TRUE(content::ExecuteScript( 114 ASSERT_TRUE(content::ExecuteScript(
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::RawKeyDown, blink::WebInputEvent::NoModifiers, 121 blink::WebKeyboardEvent::RawKeyDown, blink::WebInputEvent::NoModifiers,
122 blink::WebInputEvent::TimeStampForTesting); 122 blink::WebInputEvent::TimeStampForTesting);
123 event.windowsKeyCode = key; 123 event.windowsKeyCode = key;
124 RenderViewHost()->GetWidget()->ForwardKeyboardEvent(event); 124 RenderViewHost()->GetWidget()->ForwardKeyboardEventWithLatencyInfo(
125 event, ui::LatencyInfo());
125 } 126 }
126 127
127 bool GenerationPopupShowing() { 128 bool GenerationPopupShowing() {
128 return observer_.popup_showing() && observer_.password_visible(); 129 return observer_.popup_showing() && observer_.password_visible();
129 } 130 }
130 131
131 bool EditingPopupShowing() { 132 bool EditingPopupShowing() {
132 return observer_.popup_showing() && !observer_.password_visible(); 133 return observer_.popup_showing() && !observer_.password_visible();
133 } 134 }
134 135
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 EXPECT_FALSE(password_store->IsEmpty()); 223 EXPECT_FALSE(password_store->IsEmpty());
223 224
224 // Make sure the username is correct. 225 // Make sure the username is correct.
225 password_manager::TestPasswordStore::PasswordMap stored_passwords = 226 password_manager::TestPasswordStore::PasswordMap stored_passwords =
226 password_store->stored_passwords(); 227 password_store->stored_passwords();
227 EXPECT_EQ(1u, stored_passwords.size()); 228 EXPECT_EQ(1u, stored_passwords.size());
228 EXPECT_EQ(1u, stored_passwords.begin()->second.size()); 229 EXPECT_EQ(1u, stored_passwords.begin()->second.size());
229 EXPECT_EQ(base::UTF8ToUTF16("something"), 230 EXPECT_EQ(base::UTF8ToUTF16("something"),
230 (stored_passwords.begin()->second)[0].username_value); 231 (stored_passwords.begin()->second)[0].username_value);
231 } 232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698