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 "content/browser/fileapi/upload_file_system_file_element_reader.h" | 5 #include "content/browser/fileapi/upload_file_system_file_element_reader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 class UploadFileSystemFileElementReaderTest : public testing::Test { | 41 class UploadFileSystemFileElementReaderTest : public testing::Test { |
42 public: | 42 public: |
43 UploadFileSystemFileElementReaderTest() {} | 43 UploadFileSystemFileElementReaderTest() {} |
44 | 44 |
45 void SetUp() override { | 45 void SetUp() override { |
46 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 46 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
47 | 47 |
48 file_system_context_ = CreateFileSystemContextForTesting( | 48 file_system_context_ = |
49 NULL, temp_dir_.path()); | 49 CreateFileSystemContextForTesting(NULL, temp_dir_.GetPath()); |
50 | 50 |
51 file_system_context_->OpenFileSystem( | 51 file_system_context_->OpenFileSystem( |
52 GURL(kFileSystemURLOrigin), | 52 GURL(kFileSystemURLOrigin), |
53 kFileSystemType, | 53 kFileSystemType, |
54 storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 54 storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, |
55 base::Bind(&UploadFileSystemFileElementReaderTest::OnOpenFileSystem, | 55 base::Bind(&UploadFileSystemFileElementReaderTest::OnOpenFileSystem, |
56 base::Unretained(this))); | 56 base::Unretained(this))); |
57 base::RunLoop().RunUntilIdle(); | 57 base::RunLoop().RunUntilIdle(); |
58 ASSERT_TRUE(file_system_root_url_.is_valid()); | 58 ASSERT_TRUE(file_system_root_url_.is_valid()); |
59 | 59 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 const GURL wrong_url = GetFileSystemURL("wrong_file_name.dat"); | 275 const GURL wrong_url = GetFileSystemURL("wrong_file_name.dat"); |
276 reader_.reset(new UploadFileSystemFileElementReader( | 276 reader_.reset(new UploadFileSystemFileElementReader( |
277 file_system_context_.get(), wrong_url, 0, | 277 file_system_context_.get(), wrong_url, 0, |
278 std::numeric_limits<uint64_t>::max(), base::Time())); | 278 std::numeric_limits<uint64_t>::max(), base::Time())); |
279 net::TestCompletionCallback init_callback; | 279 net::TestCompletionCallback init_callback; |
280 ASSERT_EQ(net::ERR_IO_PENDING, reader_->Init(init_callback.callback())); | 280 ASSERT_EQ(net::ERR_IO_PENDING, reader_->Init(init_callback.callback())); |
281 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, init_callback.WaitForResult()); | 281 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, init_callback.WaitForResult()); |
282 } | 282 } |
283 | 283 |
284 } // namespace content | 284 } // namespace content |
OLD | NEW |