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

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client_unittest.cc

Issue 2722293004: Hide password saving UI for automated tests. (Closed)
Patch Set: don't split up the && expression Created 3 years, 9 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
« no previous file with comments | « chrome/browser/password_manager/chrome_password_manager_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
index 7b8d6b5058ab12885dcbd4bf433636cc526fb6d5..19fd0840d5e2dd33e041026b277412d6d8f6a753 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -8,6 +8,7 @@
#include <string>
+#include "base/command_line.h"
#include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
@@ -17,6 +18,7 @@
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/profile_sync_test_util.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/autofill/content/common/autofill_agent.mojom.h"
@@ -363,6 +365,15 @@ TEST_F(ChromePasswordManagerClientTest, SavingAndFillingEnabledConditionsTest) {
profile()->ForceIncognito(false);
}
+TEST_F(ChromePasswordManagerClientTest, SavingDependsOnAutomation) {
+ // Test that saving passwords UI is disabled for automated tests.
+ ChromePasswordManagerClient* client = GetClient();
+ EXPECT_TRUE(client->IsSavingAndFillingEnabledForCurrentPage());
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableAutomation);
+ EXPECT_FALSE(client->IsSavingAndFillingEnabledForCurrentPage());
+}
+
TEST_F(ChromePasswordManagerClientTest, GetLastCommittedEntryURL_Empty) {
EXPECT_EQ(GURL::EmptyGURL(), GetClient()->GetLastCommittedEntryURL());
}
« no previous file with comments | « chrome/browser/password_manager/chrome_password_manager_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698