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

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

Issue 1003953008: Remove prerender cookie store, part 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prerender-revert-cookie-store-3
Patch Set: rebase (just in case since this is so huge) Created 5 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_file_job.h" 5 #include "net/url_request/url_request_file_job.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void URLRequestFileJobEventsTest::RunRequest(const std::string& content, 182 void URLRequestFileJobEventsTest::RunRequest(const std::string& content,
183 const Range* range) { 183 const Range* range) {
184 base::ScopedTempDir directory; 184 base::ScopedTempDir directory;
185 ASSERT_TRUE(directory.CreateUniqueTempDir()); 185 ASSERT_TRUE(directory.CreateUniqueTempDir());
186 base::FilePath path; 186 base::FilePath path;
187 ASSERT_TRUE(CreateTempFileWithContent(content, directory, &path)); 187 ASSERT_TRUE(CreateTempFileWithContent(content, directory, &path));
188 CallbacksJobFactory factory(path, &observer_); 188 CallbacksJobFactory factory(path, &observer_);
189 context_.set_job_factory(&factory); 189 context_.set_job_factory(&factory);
190 190
191 scoped_ptr<URLRequest> request(context_.CreateRequest( 191 scoped_ptr<URLRequest> request(context_.CreateRequest(
192 FilePathToFileURL(path), DEFAULT_PRIORITY, &delegate_, NULL)); 192 FilePathToFileURL(path), DEFAULT_PRIORITY, &delegate_));
193 if (range) { 193 if (range) {
194 ASSERT_GE(range->start, 0); 194 ASSERT_GE(range->start, 0);
195 ASSERT_GE(range->end, 0); 195 ASSERT_GE(range->end, 0);
196 ASSERT_LE(range->start, range->end); 196 ASSERT_LE(range->start, range->end);
197 ASSERT_LT(static_cast<unsigned int>(range->end), content.length()); 197 ASSERT_LT(static_cast<unsigned int>(range->end), content.length());
198 std::string range_value = 198 std::string range_value =
199 base::StringPrintf("bytes=%d-%d", range->start, range->end); 199 base::StringPrintf("bytes=%d-%d", range->start, range->end);
200 request->SetExtraRequestHeaderByName( 200 request->SetExtraRequestHeaderByName(
201 HttpRequestHeaders::kRange, range_value, true /*overwrite*/); 201 HttpRequestHeaders::kRange, range_value, true /*overwrite*/);
202 } 202 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // Use a 15KB content file and read a range chosen somewhat arbitrarily but 260 // Use a 15KB content file and read a range chosen somewhat arbitrarily but
261 // not aligned on any likely page boundaries. 261 // not aligned on any likely page boundaries.
262 int size = 15 * 1024; 262 int size = 15 * 1024;
263 Range range(1701, (6 * 1024) + 3); 263 Range range(1701, (6 * 1024) + 3);
264 RunRequest(MakeContentOfSize(size), &range); 264 RunRequest(MakeContentOfSize(size), &range);
265 } 265 }
266 266
267 } // namespace 267 } // namespace
268 268
269 } // namespace net 269 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context_builder_unittest.cc ('k') | net/url_request/url_request_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698