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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 {"https://example.com", "user", "secret", nullptr, nullptr, 0}, | 322 {"https://example.com", "user", "secret", nullptr, nullptr, 0}, |
323 {"https://example.com", "user", "secret", nullptr, "https://fed1.com", 1}, | 323 {"https://example.com", "user", "secret", nullptr, "https://fed1.com", 1}, |
324 {"https://example.com", "user", "secret", nullptr, "https://fed2.com", | 324 {"https://example.com", "user", "secret", nullptr, "https://fed2.com", |
325 2}}; | 325 2}}; |
326 SortAndCheckPositions(test_cases, arraysize(test_cases), | 326 SortAndCheckPositions(test_cases, arraysize(test_cases), |
327 PasswordEntryType::SAVED); | 327 PasswordEntryType::SAVED); |
328 } | 328 } |
329 | 329 |
330 TEST_F(PasswordManagerPresenterTest, Sorting_SpecialCharacters) { | 330 TEST_F(PasswordManagerPresenterTest, Sorting_SpecialCharacters) { |
331 // URLs with encoded special characters should not cause crash during sorting. | 331 // URLs with encoded special characters should not cause crash during sorting. |
332 LOG(INFO) << GURL("http://abč.com"); | |
333 LOG(INFO) << GURL("http://abc.com"); | |
334 LOG(INFO) << GURL("http://ábc.com"); | |
335 LOG(INFO) << GURL("http://uoy.com"); | |
336 LOG(INFO) << GURL("http://üöÿ.com"); | |
337 LOG(INFO) << GURL("http://zrc.com"); | |
338 LOG(INFO) << GURL("http://žřč.com"); | |
339 const SortEntry test_cases[] = { | 332 const SortEntry test_cases[] = { |
340 {"https://xn--bea5m6d.com/", "user_a", "pwd", nullptr, nullptr, 4}, | 333 {"https://xn--bea5m6d.com/", "user_a", "pwd", nullptr, nullptr, 4}, |
341 {"https://uoy.com/", "user_a", "pwd", nullptr, nullptr, 1}, | 334 {"https://uoy.com/", "user_a", "pwd", nullptr, nullptr, 1}, |
342 {"https://zrc.com/", "user_a", "pwd", nullptr, nullptr, 6}, | 335 {"https://zrc.com/", "user_a", "pwd", nullptr, nullptr, 6}, |
343 {"https://abc.com/", "user_a", "pwd", nullptr, nullptr, 0}, | 336 {"https://abc.com/", "user_a", "pwd", nullptr, nullptr, 0}, |
344 {"https://xn--ab-fma.com/", "user_a", "pwd", nullptr, nullptr, 2}, | 337 {"https://xn--ab-fma.com/", "user_a", "pwd", nullptr, nullptr, 2}, |
345 {"https://xn--bc-lia.com/", "user_a", "pwd", nullptr, nullptr, 3}, | 338 {"https://xn--bc-lia.com/", "user_a", "pwd", nullptr, nullptr, 3}, |
346 {"https://xn--ndalk.com/", "user_a", "pwd", nullptr, nullptr, 5}, | 339 {"https://xn--ndalk.com/", "user_a", "pwd", nullptr, nullptr, 5}, |
347 }; | 340 }; |
348 SortAndCheckPositions(test_cases, arraysize(test_cases), | 341 SortAndCheckPositions(test_cases, arraysize(test_cases), |
349 PasswordEntryType::SAVED); | 342 PasswordEntryType::SAVED); |
350 } | 343 } |
351 | 344 |
352 } // namespace | 345 } // namespace |
OLD | NEW |