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

Unified Diff: chrome/renderer/autofill/password_generation_test_utils.cc

Issue 1184913002: [Password Manager] Suppress UI when password generation is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/autofill/password_generation_test_utils.cc
diff --git a/chrome/renderer/autofill/password_generation_test_utils.cc b/chrome/renderer/autofill/password_generation_test_utils.cc
index 1db160e5419a6283b42cbf043031b6dcadd4852c..83c88dfeed9240a3bbaac3ae375ee06f98efba84 100644
--- a/chrome/renderer/autofill/password_generation_test_utils.cc
+++ b/chrome/renderer/autofill/password_generation_test_utils.cc
@@ -9,6 +9,7 @@
#include "components/autofill/content/common/autofill_messages.h"
#include "components/autofill/content/renderer/form_autofill_util.h"
#include "components/autofill/content/renderer/test_password_generation_agent.h"
+#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFormElement.h"
@@ -45,4 +46,17 @@ void SetAccountCreationFormsDetectedMessage(
generation_agent->OnMessageReceived(msg);
}
+void ExpectPasswordGenerationAvailable(
+ TestPasswordGenerationAgent* password_generation,
+ bool available) {
+ if (available) {
+ ASSERT_EQ(1u, password_generation->messages().size());
+ EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID,
+ password_generation->messages()[0]->type());
+ } else {
+ EXPECT_TRUE(password_generation->messages().empty());
+ }
+ password_generation->clear_messages();
+}
+
} // namespace autofill
« no previous file with comments | « chrome/renderer/autofill/password_generation_test_utils.h ('k') | components/autofill/content/renderer/autofill_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698