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

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

Powered by Google App Engine
This is Rietveld 408576698