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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 4366001: base: Move CaseInsensitiveCompare traits into the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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/http/http_util.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/url_request/url_request_unittest.h" 5 #include "net/url_request/url_request_unittest.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return "header"; 62 return "header";
63 } 63 }
64 64
65 // Do a case-insensitive search through |haystack| for |needle|. 65 // Do a case-insensitive search through |haystack| for |needle|.
66 bool ContainsString(const std::string& haystack, const char* needle) { 66 bool ContainsString(const std::string& haystack, const char* needle) {
67 std::string::const_iterator it = 67 std::string::const_iterator it =
68 std::search(haystack.begin(), 68 std::search(haystack.begin(),
69 haystack.end(), 69 haystack.end(),
70 needle, 70 needle,
71 needle + strlen(needle), 71 needle + strlen(needle),
72 CaseInsensitiveCompare<char>()); 72 base::CaseInsensitiveCompare<char>());
73 return it != haystack.end(); 73 return it != haystack.end();
74 } 74 }
75 75
76 void FillBuffer(char* buffer, size_t len) { 76 void FillBuffer(char* buffer, size_t len) {
77 static bool called = false; 77 static bool called = false;
78 if (!called) { 78 if (!called) {
79 called = true; 79 called = true;
80 int seed = static_cast<int>(Time::Now().ToInternalValue()); 80 int seed = static_cast<int>(Time::Now().ToInternalValue());
81 srand(seed); 81 srand(seed);
82 } 82 }
(...skipping 2548 matching lines...) Expand 10 before | Expand all | Expand 10 after
2631 TestURLRequest 2631 TestURLRequest
2632 req(test_server_.GetURL("echoheaderoverride?Accept-Charset"), &d); 2632 req(test_server_.GetURL("echoheaderoverride?Accept-Charset"), &d);
2633 req.set_context(new TestURLRequestContext()); 2633 req.set_context(new TestURLRequestContext());
2634 net::HttpRequestHeaders headers; 2634 net::HttpRequestHeaders headers;
2635 headers.SetHeader(net::HttpRequestHeaders::kAcceptCharset, "koi-8r"); 2635 headers.SetHeader(net::HttpRequestHeaders::kAcceptCharset, "koi-8r");
2636 req.SetExtraRequestHeaders(headers); 2636 req.SetExtraRequestHeaders(headers);
2637 req.Start(); 2637 req.Start();
2638 MessageLoop::current()->Run(); 2638 MessageLoop::current()->Run();
2639 EXPECT_EQ(std::string("koi-8r"), d.data_received()); 2639 EXPECT_EQ(std::string("koi-8r"), d.data_received());
2640 } 2640 }
OLDNEW
« no previous file with comments | « net/http/http_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698