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

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

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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_file_stream_reader.h" 5 #include "webkit/fileapi/file_system_file_stream_reader.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop.h" 12 #include "base/message_loop.h"
12 #include "base/platform_file.h" 13 #include "base/platform_file.h"
13 #include "base/scoped_temp_dir.h"
14 #include "net/base/io_buffer.h" 14 #include "net/base/io_buffer.h"
15 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
16 #include "net/base/test_completion_callback.h" 16 #include "net/base/test_completion_callback.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include "webkit/fileapi/file_system_context.h" 18 #include "webkit/fileapi/file_system_context.h"
19 #include "webkit/fileapi/file_system_file_util.h" 19 #include "webkit/fileapi/file_system_file_util.h"
20 #include "webkit/fileapi/file_system_operation_context.h" 20 #include "webkit/fileapi/file_system_operation_context.h"
21 #include "webkit/fileapi/file_system_task_runners.h" 21 #include "webkit/fileapi/file_system_task_runners.h"
22 #include "webkit/fileapi/mock_file_system_options.h" 22 #include "webkit/fileapi/mock_file_system_options.h"
23 #include "webkit/fileapi/sandbox_mount_point_provider.h" 23 #include "webkit/fileapi/sandbox_mount_point_provider.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 ASSERT_EQ(base::PLATFORM_FILE_OK, result); 144 ASSERT_EQ(base::PLATFORM_FILE_OK, result);
145 } 145 }
146 146
147 FileSystemURL GetFileSystemURL(const std::string& file_name) { 147 FileSystemURL GetFileSystemURL(const std::string& file_name) {
148 return FileSystemURL(GURL(kURLOrigin), 148 return FileSystemURL(GURL(kURLOrigin),
149 kFileSystemTypeTemporary, 149 kFileSystemTypeTemporary,
150 FilePath().AppendASCII(file_name)); 150 FilePath().AppendASCII(file_name));
151 } 151 }
152 152
153 MessageLoop message_loop_; 153 MessageLoop message_loop_;
154 ScopedTempDir temp_dir_; 154 base::ScopedTempDir temp_dir_;
155 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy_; 155 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy_;
156 scoped_refptr<FileSystemContext> file_system_context_; 156 scoped_refptr<FileSystemContext> file_system_context_;
157 base::Time test_file_modification_time_; 157 base::Time test_file_modification_time_;
158 }; 158 };
159 159
160 TEST_F(FileSystemFileStreamReaderTest, NonExistent) { 160 TEST_F(FileSystemFileStreamReaderTest, NonExistent) {
161 const char kFileName[] = "nonexistent"; 161 const char kFileName[] = "nonexistent";
162 scoped_ptr<FileSystemFileStreamReader> reader( 162 scoped_ptr<FileSystemFileStreamReader> reader(
163 CreateFileReader(kFileName, 0, base::Time())); 163 CreateFileReader(kFileName, 0, base::Time()));
164 int result = 0; 164 int result = 0;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 new net::IOBufferWithSize(kTestDataSize)); 279 new net::IOBufferWithSize(kTestDataSize));
280 int rv = reader->Read(buf, buf->size(), base::Bind(&NeverCalled)); 280 int rv = reader->Read(buf, buf->size(), base::Bind(&NeverCalled));
281 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); 281 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0);
282 282
283 // Delete immediately. 283 // Delete immediately.
284 // Should not crash; nor should NeverCalled be callback. 284 // Should not crash; nor should NeverCalled be callback.
285 reader.reset(); 285 reader.reset();
286 } 286 }
287 287
288 } // namespace fileapi 288 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_directory_database_unittest.cc ('k') | webkit/fileapi/file_system_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698