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/signin/local_auth.h" | 5 #include "chrome/browser/signin/local_auth.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/prefs/pref_service.h" | |
11 #include "build/build_config.h" | 10 #include "build/build_config.h" |
12 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
13 #include "chrome/test/base/testing_browser_process.h" | 12 #include "chrome/test/base/testing_browser_process.h" |
14 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
15 #include "chrome/test/base/testing_profile_manager.h" | 14 #include "chrome/test/base/testing_profile_manager.h" |
16 #include "components/os_crypt/os_crypt.h" | 15 #include "components/os_crypt/os_crypt.h" |
| 16 #include "components/prefs/pref_service.h" |
17 #include "components/syncable_prefs/testing_pref_service_syncable.h" | 17 #include "components/syncable_prefs/testing_pref_service_syncable.h" |
18 #include "content/public/test/test_browser_thread_bundle.h" | 18 #include "content/public/test/test_browser_thread_bundle.h" |
19 | 19 |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 class LocalAuthTest : public testing::Test { | 22 class LocalAuthTest : public testing::Test { |
23 content::TestBrowserThreadBundle thread_bundle_; | 23 content::TestBrowserThreadBundle thread_bundle_; |
24 }; | 24 }; |
25 | 25 |
26 TEST_F(LocalAuthTest, SetAndCheckCredentials) { | 26 TEST_F(LocalAuthTest, SetAndCheckCredentials) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 TEST_F(LocalAuthTest, TruncateStringUnevenly) { | 113 TEST_F(LocalAuthTest, TruncateStringUnevenly) { |
114 std::string two_chars = "Az"; | 114 std::string two_chars = "Az"; |
115 std::string three_chars = "AzC"; | 115 std::string three_chars = "AzC"; |
116 // 'z' = 0x7A, ':' = 0x3A. | 116 // 'z' = 0x7A, ':' = 0x3A. |
117 std::string two_chars_truncated = "A:"; | 117 std::string two_chars_truncated = "A:"; |
118 EXPECT_EQ(two_chars_truncated, | 118 EXPECT_EQ(two_chars_truncated, |
119 LocalAuth::TruncateStringByBits(two_chars, 14)); | 119 LocalAuth::TruncateStringByBits(two_chars, 14)); |
120 EXPECT_EQ(two_chars_truncated, | 120 EXPECT_EQ(two_chars_truncated, |
121 LocalAuth::TruncateStringByBits(three_chars, 14)); | 121 LocalAuth::TruncateStringByBits(three_chars, 14)); |
122 } | 122 } |
OLD | NEW |