| 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/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // Functionality disabled in Incognito mode also when manager itself is | 450 // Functionality disabled in Incognito mode also when manager itself is |
| 451 // enabled. | 451 // enabled. |
| 452 prefs()->SetUserPref(password_manager::prefs::kPasswordManagerSavingEnabled, | 452 prefs()->SetUserPref(password_manager::prefs::kPasswordManagerSavingEnabled, |
| 453 new base::FundamentalValue(true)); | 453 new base::FundamentalValue(true)); |
| 454 EXPECT_FALSE(client->IsSavingAndFillingEnabledForCurrentPage()); | 454 EXPECT_FALSE(client->IsSavingAndFillingEnabledForCurrentPage()); |
| 455 EXPECT_TRUE(client->IsFillingEnabledForCurrentPage()); | 455 EXPECT_TRUE(client->IsFillingEnabledForCurrentPage()); |
| 456 profile()->ForceIncognito(false); | 456 profile()->ForceIncognito(false); |
| 457 } | 457 } |
| 458 | 458 |
| 459 TEST_F(ChromePasswordManagerClientTest, GetLastCommittedEntryURL_Empty) { | 459 TEST_F(ChromePasswordManagerClientTest, GetLastCommittedEntryURL_Empty) { |
| 460 EXPECT_EQ(GURL::EmptyGURL(), GetClient()->GetLastCommittedEntryURL()); | 460 EXPECT_EQ(GURL(url::kAboutBlankURL), GetClient()->GetLastCommittedEntryURL()); |
| 461 } | 461 } |
| 462 | 462 |
| 463 TEST_F(ChromePasswordManagerClientTest, GetLastCommittedEntryURL) { | 463 TEST_F(ChromePasswordManagerClientTest, GetLastCommittedEntryURL) { |
| 464 GURL kUrl( | 464 GURL kUrl( |
| 465 "https://accounts.google.com/ServiceLogin?continue=" | 465 "https://accounts.google.com/ServiceLogin?continue=" |
| 466 "https://passwords.google.com/settings&rart=123"); | 466 "https://passwords.google.com/settings&rart=123"); |
| 467 NavigateAndCommit(kUrl); | 467 NavigateAndCommit(kUrl); |
| 468 EXPECT_EQ(kUrl, GetClient()->GetLastCommittedEntryURL()); | 468 EXPECT_EQ(kUrl, GetClient()->GetLastCommittedEntryURL()); |
| 469 } | 469 } |
| OLD | NEW |