OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile_downloader.h" | 5 #include "chrome/browser/profiles/profile_downloader.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 dict->SetString("hd", hosted_domain); | 33 dict->SetString("hd", hosted_domain); |
34 } | 34 } |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 class ProfileDownloaderTest : public testing::Test { | 38 class ProfileDownloaderTest : public testing::Test { |
39 protected: | 39 protected: |
40 ProfileDownloaderTest() { | 40 ProfileDownloaderTest() { |
41 } | 41 } |
42 | 42 |
43 virtual ~ProfileDownloaderTest() { | 43 ~ProfileDownloaderTest() override {} |
44 } | |
45 | 44 |
46 void VerifyWithAccountData(const std::string& full_name, | 45 void VerifyWithAccountData(const std::string& full_name, |
47 const std::string& given_name, | 46 const std::string& given_name, |
48 const std::string& url, | 47 const std::string& url, |
49 const std::string& expected_url, | 48 const std::string& expected_url, |
50 const std::string& locale, | 49 const std::string& locale, |
51 const std::string& hosted_domain, | 50 const std::string& hosted_domain, |
52 bool include_empty_hosted_domain, | 51 bool include_empty_hosted_domain, |
53 bool is_valid) { | 52 bool is_valid) { |
54 base::string16 parsed_full_name; | 53 base::string16 parsed_full_name; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // Not default G+ photo | 205 // Not default G+ photo |
207 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( | 206 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( |
208 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAAAA/G/photo.jpg")); | 207 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAAAA/G/photo.jpg")); |
209 // Not default with 6 components | 208 // Not default with 6 components |
210 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( | 209 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( |
211 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg")); | 210 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg")); |
212 // Not default with 7 components | 211 // Not default with 7 components |
213 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( | 212 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( |
214 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s32-c/photo.jpg")); | 213 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s32-c/photo.jpg")); |
215 } | 214 } |
OLD | NEW |