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

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

Issue 256003003: Enable Automatic Passwords Saving (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
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 699aae9a360d57f072eff44750e3c31d50f35b6f..304975dcc946f166af83ffa38a6ccedaecb699be 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -2,11 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/command_line.h"
+
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
+#include "chrome/common/chrome_version_info.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/autofill/content/common/autofill_messages.h"
#include "components/password_manager/core/browser/password_manager_logger.h"
+#include "components/password_manager/core/common/password_manager_switches.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/mock_render_process_host.h"
@@ -114,3 +118,18 @@ TEST_F(ChromePasswordManagerClientTest, LogSavePasswordProgressNotifyRenderer) {
EXPECT_TRUE(WasLoggingActivationMessageSent(&logging_active));
EXPECT_FALSE(logging_active);
}
+
+TEST_F(ChromePasswordManagerClientTest,
+ IsAutomaticPasswordSavingEnabledDefaultBehaviourTest) {
+ EXPECT_FALSE(GetClient()->IsAutomaticPasswordSavingEnabled());
+}
+
+TEST_F(ChromePasswordManagerClientTest,
+ IsAutomaticPasswordSavingEnabledWhenFlagIsSetTest) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ password_manager::switches::kEnableAutomaticPasswordSaving);
+ if (chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_UNKNOWN)
+ EXPECT_TRUE(GetClient()->IsAutomaticPasswordSavingEnabled());
+ else
+ EXPECT_FALSE(GetClient()->IsAutomaticPasswordSavingEnabled());
+}

Powered by Google App Engine
This is Rietveld 408576698