| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/passwords/password_manager_presenter.h" | 5 #include "chrome/browser/ui/passwords/password_manager_presenter.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 form->password_value = base::ASCIIToUTF16(entry.password); | 140 form->password_value = base::ASCIIToUTF16(entry.password); |
| 141 } | 141 } |
| 142 if (entry.affiliated_web_realm) | 142 if (entry.affiliated_web_realm) |
| 143 form->affiliated_web_realm = entry.affiliated_web_realm; | 143 form->affiliated_web_realm = entry.affiliated_web_realm; |
| 144 list.push_back(std::move(form)); | 144 list.push_back(std::move(form)); |
| 145 if (entry.expected_position >= 0) | 145 if (entry.expected_position >= 0) |
| 146 expected_number_of_unique_entries++; | 146 expected_number_of_unique_entries++; |
| 147 } | 147 } |
| 148 | 148 |
| 149 DuplicatesMap duplicates; | 149 DuplicatesMap duplicates; |
| 150 std::string languages; | |
| 151 mock_controller_->GetPasswordManagerPresenter()->SortEntriesAndHideDuplicates( | 150 mock_controller_->GetPasswordManagerPresenter()->SortEntriesAndHideDuplicates( |
| 152 languages, &list, &duplicates, username_and_password_in_key); | 151 &list, &duplicates, username_and_password_in_key); |
| 153 | 152 |
| 154 ASSERT_EQ(expected_number_of_unique_entries, list.size()); | 153 ASSERT_EQ(expected_number_of_unique_entries, list.size()); |
| 155 ASSERT_EQ(number_of_entries - expected_number_of_unique_entries, | 154 ASSERT_EQ(number_of_entries - expected_number_of_unique_entries, |
| 156 duplicates.size()); | 155 duplicates.size()); |
| 157 for (size_t i = 0; i < number_of_entries; i++) { | 156 for (size_t i = 0; i < number_of_entries; i++) { |
| 158 const SortEntry& entry = test_entries[i]; | 157 const SortEntry& entry = test_entries[i]; |
| 159 if (entry.expected_position >= 0) { | 158 if (entry.expected_position >= 0) { |
| 160 SCOPED_TRACE(testing::Message("position in sorted list: ") | 159 SCOPED_TRACE(testing::Message("position in sorted list: ") |
| 161 << entry.expected_position); | 160 << entry.expected_position); |
| 162 EXPECT_EQ(GURL(base::ASCIIToUTF16(entry.origin)), | 161 EXPECT_EQ(GURL(base::ASCIIToUTF16(entry.origin)), |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 {"android://hash@com.alpha", "user", "secret", "https://alpha.com", -1}, | 272 {"android://hash@com.alpha", "user", "secret", "https://alpha.com", -1}, |
| 274 {"android://hash@com.alpha", "user", "secret", nullptr, 2}, | 273 {"android://hash@com.alpha", "user", "secret", nullptr, 2}, |
| 275 | 274 |
| 276 {"android://hash@com.betta.android", "user", "secret", | 275 {"android://hash@com.betta.android", "user", "secret", |
| 277 "https://betta.com", 3}, | 276 "https://betta.com", 3}, |
| 278 {"android://hash@com.betta.android", "user", "secret", nullptr, 4}}; | 277 {"android://hash@com.betta.android", "user", "secret", nullptr, 4}}; |
| 279 SortAndCheckPositions(test_cases, arraysize(test_cases), true); | 278 SortAndCheckPositions(test_cases, arraysize(test_cases), true); |
| 280 } | 279 } |
| 281 | 280 |
| 282 } // namespace | 281 } // namespace |
| OLD | NEW |