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()); |
+} |