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

Side by Side Diff: chrome/renderer/autofill/password_generation_agent_browsertest.cc

Issue 1686063004: Sending generated vote on password generation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix BUILD.gn Created 4 years, 10 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 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 #include <string.h> 5 #include <string.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/test/histogram_tester.h" 10 #include "base/test/histogram_tester.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (available) 66 if (available)
67 ASSERT_TRUE(message); 67 ASSERT_TRUE(message);
68 else 68 else
69 ASSERT_FALSE(message); 69 ASSERT_FALSE(message);
70 70
71 render_thread_->sink().ClearMessages(); 71 render_thread_->sink().ClearMessages();
72 } 72 }
73 73
74 void ShowGenerationPopUpManually(const char* element_id) { 74 void ShowGenerationPopUpManually(const char* element_id) {
75 FocusField(element_id); 75 FocusField(element_id);
76 AutofillMsg_GeneratePassword msg(0); 76 AutofillMsg_UserTriggeredGeneratePassword msg(0);
77 password_generation_->OnMessageReceived(msg); 77 password_generation_->OnMessageReceived(msg);
78 } 78 }
79 79
80 private: 80 private:
81 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationAgentTest); 81 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationAgentTest);
82 }; 82 };
83 83
84 const char kSigninFormHTML[] = 84 const char kSigninFormHTML[] =
85 "<FORM name = 'blah' action = 'http://www.random.com/'> " 85 "<FORM name = 'blah' action = 'http://www.random.com/'> "
86 " <INPUT type = 'text' id = 'username'/> " 86 " <INPUT type = 'text' id = 'username'/> "
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 576 }
577 577
578 TEST_F(PasswordGenerationAgentTest, ManualGenerationTest) { 578 TEST_F(PasswordGenerationAgentTest, ManualGenerationTest) {
579 LoadHTMLWithUserGesture(kAccountCreationFormHTML); 579 LoadHTMLWithUserGesture(kAccountCreationFormHTML);
580 ShowGenerationPopUpManually("first_password"); 580 ShowGenerationPopUpManually("first_password");
581 ExpectGenerationAvailable("first_password", true); 581 ExpectGenerationAvailable("first_password", true);
582 ExpectGenerationAvailable("second_password", false); 582 ExpectGenerationAvailable("second_password", false);
583 } 583 }
584 584
585 } // namespace autofill 585 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698