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

Side by Side Diff: webkit/fileapi/file_system_url_request_job_unittest.cc

Issue 12321106: Update TestURLRequest constructor interface in unit tests. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Make use of empty delegate more explicit, and fix one broken test. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « webkit/fileapi/file_system_dir_url_request_job_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/fileapi/file_system_url_request_job.h" 5 #include "webkit/fileapi/file_system_url_request_job.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 bool run_to_completion) { 101 bool run_to_completion) {
102 delegate_.reset(new net::TestDelegate()); 102 delegate_.reset(new net::TestDelegate());
103 // Make delegate_ exit the MessageLoop when the request is done. 103 // Make delegate_ exit the MessageLoop when the request is done.
104 delegate_->set_quit_on_complete(true); 104 delegate_->set_quit_on_complete(true);
105 delegate_->set_quit_on_redirect(true); 105 delegate_->set_quit_on_redirect(true);
106 request_.reset(empty_context_.CreateRequest(url, delegate_.get())); 106 request_.reset(empty_context_.CreateRequest(url, delegate_.get()));
107 if (headers) 107 if (headers)
108 request_->SetExtraRequestHeaders(*headers); 108 request_->SetExtraRequestHeaders(*headers);
109 ASSERT_TRUE(!job_); 109 ASSERT_TRUE(!job_);
110 job_ = new FileSystemURLRequestJob( 110 job_ = new FileSystemURLRequestJob(
111 request_.get(), 111 request_.get(), NULL, file_system_context_.get());
112 empty_context_.network_delegate(),
113 file_system_context_.get());
114 pending_job_ = job_; 112 pending_job_ = job_;
115 113
116 request_->Start(); 114 request_->Start();
117 ASSERT_TRUE(request_->is_pending()); // verify that we're starting async 115 ASSERT_TRUE(request_->is_pending()); // verify that we're starting async
118 if (run_to_completion) 116 if (run_to_completion)
119 MessageLoop::current()->Run(); 117 MessageLoop::current()->Run();
120 } 118 }
121 119
122 void TestRequest(const GURL& url) { 120 void TestRequest(const GURL& url) {
123 TestRequestHelper(url, NULL, true); 121 TestRequestHelper(url, NULL, true);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 360
363 TestRequest(CreateFileSystemURL(kFilename)); 361 TestRequest(CreateFileSystemURL(kFilename));
364 362
365 std::string mime_type_from_job; 363 std::string mime_type_from_job;
366 request_->GetMimeType(&mime_type_from_job); 364 request_->GetMimeType(&mime_type_from_job);
367 EXPECT_EQ(mime_type_direct, mime_type_from_job); 365 EXPECT_EQ(mime_type_direct, mime_type_from_job);
368 } 366 }
369 367
370 } // namespace 368 } // namespace
371 } // namespace fileapi 369 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_dir_url_request_job_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698