| OLD | NEW |
| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool get_success = request_info->extra_headers.GetHeader( | 70 bool get_success = request_info->extra_headers.GetHeader( |
| 71 "Accept-Encoding", &encoding_headers); | 71 "Accept-Encoding", &encoding_headers); |
| 72 EXPECT_TRUE(get_success); | 72 EXPECT_TRUE(get_success); |
| 73 if (!get_success) return false; | 73 if (!get_success) return false; |
| 74 | 74 |
| 75 // This check isn't wrapped with EXPECT* macros because different | 75 // This check isn't wrapped with EXPECT* macros because different |
| 76 // results from this function may be expected in different tests. | 76 // results from this function may be expected in different tests. |
| 77 for (const std::string& token : | 77 for (const std::string& token : |
| 78 base::SplitString(encoding_headers, ", ", base::KEEP_WHITESPACE, | 78 base::SplitString(encoding_headers, ", ", base::KEEP_WHITESPACE, |
| 79 base::SPLIT_WANT_NONEMPTY)) { | 79 base::SPLIT_WANT_NONEMPTY)) { |
| 80 if (!base::strncasecmp(token.data(), "sdch", token.length())) | 80 if (base::EqualsCaseInsensitiveASCII(token, "sdch")) |
| 81 return true; | 81 return true; |
| 82 } | 82 } |
| 83 return false; | 83 return false; |
| 84 } | 84 } |
| 85 | 85 |
| 86 void EnableSdch() { | 86 void EnableSdch() { |
| 87 context_.SetSdchManager(scoped_ptr<SdchManager>(new SdchManager).Pass()); | 87 context_.SetSdchManager(scoped_ptr<SdchManager>(new SdchManager).Pass()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 MockNetworkLayer network_layer_; | 90 MockNetworkLayer network_layer_; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 req_->SetLoadFlags(LOAD_DISABLE_CACHE); | 343 req_->SetLoadFlags(LOAD_DISABLE_CACHE); |
| 344 job->Start(); | 344 job->Start(); |
| 345 base::RunLoop().RunUntilIdle(); | 345 base::RunLoop().RunUntilIdle(); |
| 346 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status()); | 346 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status()); |
| 347 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); | 347 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); |
| 348 } | 348 } |
| 349 | 349 |
| 350 } // namespace | 350 } // namespace |
| 351 | 351 |
| 352 } // namespace net | 352 } // namespace net |
| OLD | NEW |