OLD | NEW |
---|---|
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 <string.h> | 5 #include <string.h> |
6 #include <algorithm> | 6 #include <algorithm> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 } else if (status > 0) { | 111 } else if (status > 0) { |
112 SetStatus(net::URLRequestStatus()); | 112 SetStatus(net::URLRequestStatus()); |
113 } else { | 113 } else { |
114 ASSERT_FALSE(true) << "Unexpected OnReadCompleted callback."; | 114 ASSERT_FALSE(true) << "Unexpected OnReadCompleted callback."; |
115 } | 115 } |
116 | 116 |
117 NotifyReadComplete(status); | 117 NotifyReadComplete(status); |
118 } | 118 } |
119 | 119 |
120 bool GetContentEncodings( | 120 bool GetContentEncodings( |
121 std::vector<Filter::FilterType>* encoding_types) { | 121 std::vector<net::Filter::FilterType>* encoding_types) { |
tfarina
2011/03/08 20:54:49
Can you try changing this file from anonymous name
adamk
2011/03/08 21:35:20
Done. Note that I put the namespace at the top he
| |
122 if (request_->url().spec() == "test:basic") { | 122 if (request_->url().spec() == "test:basic") { |
123 return false; | 123 return false; |
124 } else if (request_->url().spec() == "test:compressed") { | 124 } else if (request_->url().spec() == "test:compressed") { |
125 encoding_types->push_back(Filter::FILTER_TYPE_GZIP); | 125 encoding_types->push_back(net::Filter::FILTER_TYPE_GZIP); |
126 return true; | 126 return true; |
127 } else { | 127 } else { |
128 return net::URLRequestJob::GetContentEncodings(encoding_types); | 128 return net::URLRequestJob::GetContentEncodings(encoding_types); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 // The data to send, will be set in Start(). | 132 // The data to send, will be set in Start(). |
133 std::string response_data_; | 133 std::string response_data_; |
134 | 134 |
135 // Should reads be synchronous or asynchronous? | 135 // Should reads be synchronous or asynchronous? |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 g_async_reads = true; | 225 g_async_reads = true; |
226 AssertJobTrackerCallbacks("test:compressed"); | 226 AssertJobTrackerCallbacks("test:compressed"); |
227 } | 227 } |
228 | 228 |
229 TEST_F(URLRequestJobTrackerTest, CompressedSync) { | 229 TEST_F(URLRequestJobTrackerTest, CompressedSync) { |
230 g_async_reads = false; | 230 g_async_reads = false; |
231 AssertJobTrackerCallbacks("test:compressed"); | 231 AssertJobTrackerCallbacks("test:compressed"); |
232 } | 232 } |
233 | 233 |
234 } // namespace | 234 } // namespace |
OLD | NEW |