| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/password_manager/password_manager_test_base.h" | 8 #include "chrome/browser/password_manager/password_manager_test_base.h" |
| 9 #include "chrome/browser/password_manager/password_store_factory.h" | 9 #include "chrome/browser/password_manager/password_store_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // There should be an entry for both psl.example.com and www.example.com. | 156 // There should be an entry for both psl.example.com and www.example.com. |
| 157 password_manager::TestPasswordStore::PasswordMap passwords = | 157 password_manager::TestPasswordStore::PasswordMap passwords = |
| 158 password_store->stored_passwords(); | 158 password_store->stored_passwords(); |
| 159 GURL www_url = https_test_server().GetURL("www.example.com", "/"); | 159 GURL www_url = https_test_server().GetURL("www.example.com", "/"); |
| 160 EXPECT_EQ(2U, passwords.size()); | 160 EXPECT_EQ(2U, passwords.size()); |
| 161 EXPECT_TRUE(base::ContainsKey(passwords, psl_url.spec())); | 161 EXPECT_TRUE(base::ContainsKey(passwords, psl_url.spec())); |
| 162 EXPECT_TRUE(base::ContainsKey(passwords, www_url.spec())); | 162 EXPECT_TRUE(base::ContainsKey(passwords, www_url.spec())); |
| 163 } | 163 } |
| 164 | 164 |
| 165 // Flaky. See crbug.com/703305 |
| 165 IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, | 166 IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, |
| 166 ObsoleteHttpCredentialMovedOnMigrationToHstsSite) { | 167 DISABLED_ObsoleteHttpCredentialMovedOnMigrationToHstsSite) { |
| 167 // Add an http credential to the password store. | 168 // Add an http credential to the password store. |
| 168 GURL https_origin = https_test_server().base_url(); | 169 GURL https_origin = https_test_server().base_url(); |
| 169 ASSERT_TRUE(https_origin.SchemeIs(url::kHttpsScheme)); | 170 ASSERT_TRUE(https_origin.SchemeIs(url::kHttpsScheme)); |
| 170 GURL::Replacements rep; | 171 GURL::Replacements rep; |
| 171 rep.SetSchemeStr(url::kHttpScheme); | 172 rep.SetSchemeStr(url::kHttpScheme); |
| 172 GURL http_origin = https_origin.ReplaceComponents(rep); | 173 GURL http_origin = https_origin.ReplaceComponents(rep); |
| 173 autofill::PasswordForm http_form; | 174 autofill::PasswordForm http_form; |
| 174 http_form.signon_realm = http_origin.spec(); | 175 http_form.signon_realm = http_origin.spec(); |
| 175 http_form.origin = http_origin; | 176 http_form.origin = http_origin; |
| 176 http_form.username_value = base::ASCIIToUTF16("user"); | 177 http_form.username_value = base::ASCIIToUTF16("user"); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 signin_form.skip_zero_click = false; | 347 signin_form.skip_zero_click = false; |
| 347 signin_form.times_used = 1; | 348 signin_form.times_used = 1; |
| 348 signin_form.password_value = base::ASCIIToUTF16("API"); | 349 signin_form.password_value = base::ASCIIToUTF16("API"); |
| 349 password_manager::TestPasswordStore::PasswordMap stored = | 350 password_manager::TestPasswordStore::PasswordMap stored = |
| 350 password_store->stored_passwords(); | 351 password_store->stored_passwords(); |
| 351 ASSERT_EQ(1u, stored.size()); | 352 ASSERT_EQ(1u, stored.size()); |
| 352 EXPECT_EQ(signin_form, stored[signin_form.signon_realm][0]); | 353 EXPECT_EQ(signin_form, stored[signin_form.signon_realm][0]); |
| 353 } | 354 } |
| 354 | 355 |
| 355 } // namespace | 356 } // namespace |
| OLD | NEW |