OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 private: | 66 private: |
67 DISALLOW_COPY_AND_ASSIGN(MockChromePasswordManagerClient); | 67 DISALLOW_COPY_AND_ASSIGN(MockChromePasswordManagerClient); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace | 70 } // namespace |
71 | 71 |
72 class ChromePasswordManagerClientTest : public ChromeRenderViewHostTestHarness { | 72 class ChromePasswordManagerClientTest : public ChromeRenderViewHostTestHarness { |
73 public: | 73 public: |
74 ChromePasswordManagerClientTest(); | 74 ChromePasswordManagerClientTest(); |
75 | 75 |
76 virtual void SetUp() override; | 76 void SetUp() override; |
77 | 77 |
78 TestingPrefServiceSyncable* prefs() { | 78 TestingPrefServiceSyncable* prefs() { |
79 return profile()->GetTestingPrefService(); | 79 return profile()->GetTestingPrefService(); |
80 } | 80 } |
81 | 81 |
82 protected: | 82 protected: |
83 ChromePasswordManagerClient* GetClient(); | 83 ChromePasswordManagerClient* GetClient(); |
84 | 84 |
85 // If the test IPC sink contains an AutofillMsg_SetLoggingState message, then | 85 // If the test IPC sink contains an AutofillMsg_SetLoggingState message, then |
86 // copies its argument into |activation_flag| and returns true. Otherwise | 86 // copies its argument into |activation_flag| and returns true. Otherwise |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 profile()->ForceIncognito(true); | 468 profile()->ForceIncognito(true); |
469 EXPECT_FALSE(client->IsSavingEnabledForCurrentPage()); | 469 EXPECT_FALSE(client->IsSavingEnabledForCurrentPage()); |
470 | 470 |
471 // Functionality disabled in Incognito mode also when manager itself is | 471 // Functionality disabled in Incognito mode also when manager itself is |
472 // enabled. | 472 // enabled. |
473 prefs()->SetUserPref(password_manager::prefs::kPasswordManagerSavingEnabled, | 473 prefs()->SetUserPref(password_manager::prefs::kPasswordManagerSavingEnabled, |
474 new base::FundamentalValue(true)); | 474 new base::FundamentalValue(true)); |
475 EXPECT_FALSE(client->IsSavingEnabledForCurrentPage()); | 475 EXPECT_FALSE(client->IsSavingEnabledForCurrentPage()); |
476 profile()->ForceIncognito(false); | 476 profile()->ForceIncognito(false); |
477 } | 477 } |
OLD | NEW |