Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Side by Side Diff: chrome/browser/profiles/profile_downloader_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace { 10 namespace {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 true); 61 true);
62 62
63 // URL with unknown format. 63 // URL with unknown format.
64 VerifyWithNameAndURL( 64 VerifyWithNameAndURL(
65 "Pat Smith", 65 "Pat Smith",
66 "http://lh0.ggpht.com/-abcd1aBCDEf/AAAA/AAA_A/", 66 "http://lh0.ggpht.com/-abcd1aBCDEf/AAAA/AAA_A/",
67 "http://lh0.ggpht.com/-abcd1aBCDEf/AAAA/AAA_A/", 67 "http://lh0.ggpht.com/-abcd1aBCDEf/AAAA/AAA_A/",
68 true); 68 true);
69 69
70 // Data with only name. 70 // Data with only name.
71 VerifyWithNameAndURL("Pat Smith", "", "", true); 71 VerifyWithNameAndURL("Pat Smith", std::string(), std::string(), true);
72 72
73 // Data with only URL. 73 // Data with only URL.
74 VerifyWithNameAndURL( 74 VerifyWithNameAndURL(
75 "", 75 std::string(),
76 "https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg", 76 "https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg",
77 "https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s32-c/photo.jpg", 77 "https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s32-c/photo.jpg",
78 true); 78 true);
79 79
80 // Data without name or URL. 80 // Data without name or URL.
81 VerifyWithNameAndURL("", "", "", false); 81 VerifyWithNameAndURL(std::string(), std::string(), std::string(), false);
82 82
83 // Data with an invalid URL. 83 // Data with an invalid URL.
84 VerifyWithNameAndURL( "", "invalid url", "", false); 84 VerifyWithNameAndURL(std::string(), "invalid url", std::string(), false);
85 } 85 }
86 86
87 TEST_F(ProfileDownloaderTest, DefaultURL) { 87 TEST_F(ProfileDownloaderTest, DefaultURL) {
88 // Empty URL should be default photo 88 // Empty URL should be default photo
89 EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL("")); 89 EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL(std::string()));
90 // Picasa default photo 90 // Picasa default photo
91 EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL( 91 EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL(
92 "https://example.com/-4/AAAAAAAAAAA/AAAAAAAAAAE/G/s64-c/photo.jpg")); 92 "https://example.com/-4/AAAAAAAAAAA/AAAAAAAAAAE/G/s64-c/photo.jpg"));
93 // Not default G+ photo 93 // Not default G+ photo
94 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( 94 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL(
95 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAAAA/G/photo.jpg")); 95 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAAAA/G/photo.jpg"));
96 // Not default with 6 components 96 // Not default with 6 components
97 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( 97 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL(
98 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg")); 98 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg"));
99 // Not default with 7 components 99 // Not default with 7 components
100 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL( 100 EXPECT_FALSE(ProfileDownloader::IsDefaultProfileImageURL(
101 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s32-c/photo.jpg")); 101 "https://example.com/-4/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s32-c/photo.jpg"));
102 } 102 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/gaia_info_update_service_unittest.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698