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

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

Issue 11369179: Move url_request_test_util into net namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 1 month 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_path.h" 10 #include "base/file_path.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 MessageLoop::current()->RunAllPending(); 90 MessageLoop::current()->RunAllPending();
91 } 91 }
92 92
93 void OnValidateFileSystem(base::PlatformFileError result) { 93 void OnValidateFileSystem(base::PlatformFileError result) {
94 ASSERT_EQ(base::PLATFORM_FILE_OK, result); 94 ASSERT_EQ(base::PLATFORM_FILE_OK, result);
95 } 95 }
96 96
97 void TestRequestHelper(const GURL& url, 97 void TestRequestHelper(const GURL& url,
98 const net::HttpRequestHeaders* headers, 98 const net::HttpRequestHeaders* headers,
99 bool run_to_completion) { 99 bool run_to_completion) {
100 delegate_.reset(new TestDelegate()); 100 delegate_.reset(new net::TestDelegate());
101 // Make delegate_ exit the MessageLoop when the request is done. 101 // Make delegate_ exit the MessageLoop when the request is done.
102 delegate_->set_quit_on_complete(true); 102 delegate_->set_quit_on_complete(true);
103 delegate_->set_quit_on_redirect(true); 103 delegate_->set_quit_on_redirect(true);
104 request_.reset(empty_context_.CreateRequest(url, delegate_.get())); 104 request_.reset(empty_context_.CreateRequest(url, delegate_.get()));
105 if (headers) 105 if (headers)
106 request_->SetExtraRequestHeaders(*headers); 106 request_->SetExtraRequestHeaders(*headers);
107 ASSERT_TRUE(!job_); 107 ASSERT_TRUE(!job_);
108 job_ = new FileSystemURLRequestJob( 108 job_ = new FileSystemURLRequestJob(
109 request_.get(), 109 request_.get(),
110 empty_context_.network_delegate(), 110 empty_context_.network_delegate(),
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 MessageLoop message_loop_; 198 MessageLoop message_loop_;
199 199
200 ScopedTempDir temp_dir_; 200 ScopedTempDir temp_dir_;
201 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy_; 201 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy_;
202 scoped_refptr<FileSystemContext> file_system_context_; 202 scoped_refptr<FileSystemContext> file_system_context_;
203 base::WeakPtrFactory<FileSystemURLRequestJobTest> weak_factory_; 203 base::WeakPtrFactory<FileSystemURLRequestJobTest> weak_factory_;
204 204
205 net::URLRequestContext empty_context_; 205 net::URLRequestContext empty_context_;
206 206
207 // NOTE: order matters, request must die before delegate 207 // NOTE: order matters, request must die before delegate
208 scoped_ptr<TestDelegate> delegate_; 208 scoped_ptr<net::TestDelegate> delegate_;
209 scoped_ptr<net::URLRequest> request_; 209 scoped_ptr<net::URLRequest> request_;
210 210
211 scoped_refptr<net::URLRequestJob> pending_job_; 211 scoped_refptr<net::URLRequestJob> pending_job_;
212 static net::URLRequestJob* job_; 212 static net::URLRequestJob* job_;
213 }; 213 };
214 214
215 // static 215 // static
216 net::URLRequestJob* FileSystemURLRequestJobTest::job_ = NULL; 216 net::URLRequestJob* FileSystemURLRequestJobTest::job_ = NULL;
217 217
218 namespace { 218 namespace {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 TestRequest(CreateFileSystemURL(kFilename)); 359 TestRequest(CreateFileSystemURL(kFilename));
360 360
361 std::string mime_type_from_job; 361 std::string mime_type_from_job;
362 request_->GetMimeType(&mime_type_from_job); 362 request_->GetMimeType(&mime_type_from_job);
363 EXPECT_EQ(mime_type_direct, mime_type_from_job); 363 EXPECT_EQ(mime_type_direct, mime_type_from_job);
364 } 364 }
365 365
366 } // namespace 366 } // namespace
367 } // namespace fileapi 367 } // 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