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 7c41f7e3f56395b9eb903add4eaf392bf7ed25e0..24620722647de030676f5c0172c9f7025a2d9aab 100644 |
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc |
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc |
@@ -2,10 +2,13 @@ |
// 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/test/base/chrome_render_view_host_test_harness.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 "testing/gmock/include/gmock/gmock.h" |
@@ -76,3 +79,20 @@ TEST_F(ChromePasswordManagerClientTest, LogSavePasswordProgressDetachLogger) { |
client->LogSavePasswordProgress(kTestText); |
EXPECT_FALSE(client->IsLoggingActive()); |
} |
+ |
+TEST_F(ChromePasswordManagerClientTest, |
+ IsAutomaticPasswordSavingEnabledDefaultBehaviourTest) { |
+ ChromePasswordManagerClient* client = GetClient(); |
+ |
+ EXPECT_FALSE(client->IsAutomaticPasswordSavingEnabled()); |
vabr (Chromium)
2014/04/29 13:04:44
nit: get rid of the |client| variable and just cal
rchtara
2014/04/29 13:51:24
Done.
|
+} |
+ |
+TEST_F(ChromePasswordManagerClientTest, |
+ IsAutomaticPasswordSavingEnabledWhenFlagIsSetTest) { |
+ ChromePasswordManagerClient* client = GetClient(); |
+ |
+ CommandLine::ForCurrentProcess()->AppendSwitch( |
+ password_manager::switches::kEnableAutomaticPasswordSaving); |
+ |
+ EXPECT_TRUE(client->IsAutomaticPasswordSavingEnabled()); |
+} |