OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "storage/browser/fileapi/file_system_url_request_job.h" | 5 #include "storage/browser/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/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 delegate_.reset(new net::TestDelegate()); | 186 delegate_.reset(new net::TestDelegate()); |
187 // Make delegate_ exit the MessageLoop when the request is done. | 187 // Make delegate_ exit the MessageLoop when the request is done. |
188 delegate_->set_quit_on_complete(true); | 188 delegate_->set_quit_on_complete(true); |
189 delegate_->set_quit_on_redirect(true); | 189 delegate_->set_quit_on_redirect(true); |
190 | 190 |
191 job_factory_.reset(new FileSystemURLRequestJobFactory( | 191 job_factory_.reset(new FileSystemURLRequestJobFactory( |
192 url.GetOrigin().host(), file_system_context)); | 192 url.GetOrigin().host(), file_system_context)); |
193 empty_context_.set_job_factory(job_factory_.get()); | 193 empty_context_.set_job_factory(job_factory_.get()); |
194 | 194 |
195 request_ = empty_context_.CreateRequest( | 195 request_ = empty_context_.CreateRequest( |
196 url, net::DEFAULT_PRIORITY, delegate_.get(), NULL); | 196 url, net::DEFAULT_PRIORITY, delegate_.get()); |
197 if (headers) | 197 if (headers) |
198 request_->SetExtraRequestHeaders(*headers); | 198 request_->SetExtraRequestHeaders(*headers); |
199 | 199 |
200 request_->Start(); | 200 request_->Start(); |
201 ASSERT_TRUE(request_->is_pending()); // verify that we're starting async | 201 ASSERT_TRUE(request_->is_pending()); // verify that we're starting async |
202 if (run_to_completion) | 202 if (run_to_completion) |
203 base::MessageLoop::current()->Run(); | 203 base::MessageLoop::current()->Run(); |
204 } | 204 } |
205 | 205 |
206 void TestRequest(const GURL& url) { | 206 void TestRequest(const GURL& url) { |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 EXPECT_TRUE(delegate_->request_failed()); | 471 EXPECT_TRUE(delegate_->request_failed()); |
472 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); | 472 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); |
473 | 473 |
474 ASSERT_FALSE( | 474 ASSERT_FALSE( |
475 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( | 475 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( |
476 kValidExternalMountPoint)); | 476 kValidExternalMountPoint)); |
477 } | 477 } |
478 | 478 |
479 } // namespace | 479 } // namespace |
480 } // namespace content | 480 } // namespace content |
OLD | NEW |