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

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

Issue 437353004: Add space to Accept-Encoding header values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update SDCH test tokenization. Created 6 years, 3 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 std::string encoding_headers; 67 std::string encoding_headers;
68 bool get_success = request_info->extra_headers.GetHeader( 68 bool get_success = request_info->extra_headers.GetHeader(
69 "Accept-Encoding", &encoding_headers); 69 "Accept-Encoding", &encoding_headers);
70 EXPECT_TRUE(get_success); 70 EXPECT_TRUE(get_success);
71 if (!get_success) return false; 71 if (!get_success) return false;
72 72
73 // This check isn't wrapped with EXPECT* macros because different 73 // This check isn't wrapped with EXPECT* macros because different
74 // results from this function may be expected in different tests. 74 // results from this function may be expected in different tests.
75 std::vector<std::string> tokens; 75 std::vector<std::string> tokens;
76 size_t num_tokens = Tokenize(encoding_headers, ",", &tokens); 76 size_t num_tokens = Tokenize(encoding_headers, ", ", &tokens);
77 for (size_t i = 0; i < num_tokens; i++) { 77 for (size_t i = 0; i < num_tokens; i++) {
78 if (!base::strncasecmp(tokens[i].data(), "sdch", tokens[i].length())) 78 if (!base::strncasecmp(tokens[i].data(), "sdch", tokens[i].length()))
79 return true; 79 return true;
80 } 80 }
81 return false; 81 return false;
82 } 82 }
83 83
84 void EnableSdch() { 84 void EnableSdch() {
85 context_.SetSdchManager(scoped_ptr<SdchManager>(new SdchManager).Pass()); 85 context_.SetSdchManager(scoped_ptr<SdchManager>(new SdchManager).Pass());
86 } 86 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 req_.SetLoadFlags(LOAD_DISABLE_CACHE); 329 req_.SetLoadFlags(LOAD_DISABLE_CACHE);
330 job->Start(); 330 job->Start();
331 base::RunLoop().RunUntilIdle(); 331 base::RunLoop().RunUntilIdle();
332 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_.status().status()); 332 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_.status().status());
333 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); 333 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called());
334 } 334 }
335 335
336 } // namespace 336 } // namespace
337 337
338 } // namespace net 338 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/websockets/websocket_handshake_stream_create_helper_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698