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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 const char* buf, int buf_size, | 141 const char* buf, int buf_size, |
142 base::Time* modification_time) { | 142 base::Time* modification_time) { |
143 storage::FileSystemURL url = | 143 storage::FileSystemURL url = |
144 file_system_context_->CreateCrackedFileSystemURL( | 144 file_system_context_->CreateCrackedFileSystemURL( |
145 GURL(kFileSystemURLOrigin), | 145 GURL(kFileSystemURLOrigin), |
146 kFileSystemType, | 146 kFileSystemType, |
147 base::FilePath().AppendASCII(filename)); | 147 base::FilePath().AppendASCII(filename)); |
148 | 148 |
149 ASSERT_EQ(base::File::FILE_OK, | 149 ASSERT_EQ(base::File::FILE_OK, |
150 content::AsyncFileTestHelper::CreateFileWithData( | 150 content::AsyncFileTestHelper::CreateFileWithData( |
151 file_system_context_, url, buf, buf_size)); | 151 file_system_context_.get(), url, buf, buf_size)); |
152 | 152 |
153 base::File::Info file_info; | 153 base::File::Info file_info; |
154 ASSERT_EQ(base::File::FILE_OK, | 154 ASSERT_EQ(base::File::FILE_OK, |
155 content::AsyncFileTestHelper::GetMetadata( | 155 content::AsyncFileTestHelper::GetMetadata( |
156 file_system_context_, url, &file_info)); | 156 file_system_context_.get(), url, &file_info)); |
157 if (modification_time) | 157 if (modification_time) |
158 *modification_time = file_info.last_modified; | 158 *modification_time = file_info.last_modified; |
159 } | 159 } |
160 | 160 |
161 void OnValidateFileSystem(const GURL& root, | 161 void OnValidateFileSystem(const GURL& root, |
162 const std::string& name, | 162 const std::string& name, |
163 base::File::Error result) { | 163 base::File::Error result) { |
164 ASSERT_EQ(base::File::FILE_OK, result); | 164 ASSERT_EQ(base::File::FILE_OK, result); |
165 ASSERT_TRUE(root.is_valid()); | 165 ASSERT_TRUE(root.is_valid()); |
166 file_system_root_url_ = root; | 166 file_system_root_url_ = root; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); | 408 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); |
409 EXPECT_EQ(kTestContentType, content_type); | 409 EXPECT_EQ(kTestContentType, content_type); |
410 void* iter = NULL; | 410 void* iter = NULL; |
411 std::string content_disposition; | 411 std::string content_disposition; |
412 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( | 412 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( |
413 &iter, "Content-Disposition", &content_disposition)); | 413 &iter, "Content-Disposition", &content_disposition)); |
414 EXPECT_EQ(kTestContentDisposition, content_disposition); | 414 EXPECT_EQ(kTestContentDisposition, content_disposition); |
415 } | 415 } |
416 | 416 |
417 } // namespace content | 417 } // namespace content |
OLD | NEW |