| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <locale> | 5 #include <locale> |
| 6 | 6 |
| 7 #include "components/autofill/browser/password_generator.h" | 7 #include "components/autofill/core/browser/password_generator.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace autofill { | 10 namespace autofill { |
| 11 | 11 |
| 12 TEST(PasswordGeneratorTest, PasswordLength) { | 12 TEST(PasswordGeneratorTest, PasswordLength) { |
| 13 PasswordGenerator pg1(10); | 13 PasswordGenerator pg1(10); |
| 14 std::string password = pg1.Generate(); | 14 std::string password = pg1.Generate(); |
| 15 EXPECT_EQ(password.size(), 10u); | 15 EXPECT_EQ(password.size(), 10u); |
| 16 | 16 |
| 17 PasswordGenerator pg2(-1); | 17 PasswordGenerator pg2(-1); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 TEST(PasswordGeneratorTest, Printable) { | 49 TEST(PasswordGeneratorTest, Printable) { |
| 50 PasswordGenerator pg(12); | 50 PasswordGenerator pg(12); |
| 51 std::string password = pg.Generate(); | 51 std::string password = pg.Generate(); |
| 52 for (size_t i = 0; i < password.size(); i++) { | 52 for (size_t i = 0; i < password.size(); i++) { |
| 53 // Make sure that the character is printable. | 53 // Make sure that the character is printable. |
| 54 EXPECT_TRUE(isgraph(password[i])); | 54 EXPECT_TRUE(isgraph(password[i])); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace autofill | 58 } // namespace autofill |
| OLD | NEW |