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

Side by Side Diff: net/ftp/ftp_auth_cache_unittest.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | net/ftp/ftp_directory_listing_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/ftp/ftp_auth_cache.h" 5 #include "net/ftp/ftp_auth_cache.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "net/base/auth.h" 10 #include "net/base/auth.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 using base::ASCIIToUTF16;
14 using net::FtpAuthCache; 15 using net::FtpAuthCache;
15 16
16 namespace { 17 namespace {
17 18
18 const base::string16 kBogus(ASCIIToUTF16("bogus")); 19 const base::string16 kBogus(ASCIIToUTF16("bogus"));
19 const base::string16 kOthername(ASCIIToUTF16("othername")); 20 const base::string16 kOthername(ASCIIToUTF16("othername"));
20 const base::string16 kOtherword(ASCIIToUTF16("otherword")); 21 const base::string16 kOtherword(ASCIIToUTF16("otherword"));
21 const base::string16 kPassword(ASCIIToUTF16("password")); 22 const base::string16 kPassword(ASCIIToUTF16("password"));
22 const base::string16 kPassword1(ASCIIToUTF16("password1")); 23 const base::string16 kPassword1(ASCIIToUTF16("password1"));
23 const base::string16 kPassword2(ASCIIToUTF16("password2")); 24 const base::string16 kPassword2(ASCIIToUTF16("password2"));
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 cache.Add(GURL("ftp://last_host"), 151 cache.Add(GURL("ftp://last_host"),
151 net::AuthCredentials(kUsername, kPassword)); 152 net::AuthCredentials(kUsername, kPassword));
152 EXPECT_TRUE(cache.Lookup(GURL("ftp://host0")) == NULL); 153 EXPECT_TRUE(cache.Lookup(GURL("ftp://host0")) == NULL);
153 154
154 // Remaining entries should not get evicted. 155 // Remaining entries should not get evicted.
155 for (size_t i = 1; i < FtpAuthCache::kMaxEntries; i++) { 156 for (size_t i = 1; i < FtpAuthCache::kMaxEntries; i++) {
156 EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + base::IntToString(i)))); 157 EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + base::IntToString(i))));
157 } 158 }
158 EXPECT_TRUE(cache.Lookup(GURL("ftp://last_host"))); 159 EXPECT_TRUE(cache.Lookup(GURL("ftp://last_host")));
159 } 160 }
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | net/ftp/ftp_directory_listing_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698