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