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 <map> | 5 #include <map> |
6 #include <queue> | 6 #include <queue> |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 other_root.mount_type(), | 90 other_root.mount_type(), |
91 other_root.virtual_path().Append(GetRelativeVirtualPath(root, url))); | 91 other_root.virtual_path().Append(GetRelativeVirtualPath(root, url))); |
92 } | 92 } |
93 | 93 |
94 } // namespace | 94 } // namespace |
95 | 95 |
96 class DraggedFileUtilTest : public testing::Test { | 96 class DraggedFileUtilTest : public testing::Test { |
97 public: | 97 public: |
98 DraggedFileUtilTest() {} | 98 DraggedFileUtilTest() {} |
99 | 99 |
100 virtual void SetUp() { | 100 void SetUp() override { |
101 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 101 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
102 ASSERT_TRUE(partition_dir_.CreateUniqueTempDir()); | 102 ASSERT_TRUE(partition_dir_.CreateUniqueTempDir()); |
103 file_util_.reset(new storage::DraggedFileUtil()); | 103 file_util_.reset(new storage::DraggedFileUtil()); |
104 | 104 |
105 // Register the files/directories of RegularTestCases (with random | 105 // Register the files/directories of RegularTestCases (with random |
106 // root paths) as dropped files. | 106 // root paths) as dropped files. |
107 SimulateDropFiles(); | 107 SimulateDropFiles(); |
108 | 108 |
109 file_system_context_ = CreateFileSystemContextForTesting( | 109 file_system_context_ = CreateFileSystemContextForTesting( |
110 NULL /* quota_manager */, | 110 NULL /* quota_manager */, |
111 partition_dir_.path()); | 111 partition_dir_.path()); |
112 | 112 |
113 isolated_context()->AddReference(filesystem_id_); | 113 isolated_context()->AddReference(filesystem_id_); |
114 } | 114 } |
115 | 115 |
116 virtual void TearDown() { | 116 void TearDown() override { |
117 isolated_context()->RemoveReference(filesystem_id_); | 117 isolated_context()->RemoveReference(filesystem_id_); |
118 } | 118 } |
119 | 119 |
120 protected: | 120 protected: |
121 storage::IsolatedContext* isolated_context() const { | 121 storage::IsolatedContext* isolated_context() const { |
122 return storage::IsolatedContext::GetInstance(); | 122 return storage::IsolatedContext::GetInstance(); |
123 } | 123 } |
124 const base::FilePath& root_path() const { | 124 const base::FilePath& root_path() const { |
125 return data_dir_.path(); | 125 return data_dir_.path(); |
126 } | 126 } |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 EXPECT_EQ(base::File::FILE_OK, | 548 EXPECT_EQ(base::File::FILE_OK, |
549 file_util()->Truncate(GetOperationContext().get(), url, 999)); | 549 file_util()->Truncate(GetOperationContext().get(), url, 999)); |
550 ASSERT_EQ(base::File::FILE_OK, | 550 ASSERT_EQ(base::File::FILE_OK, |
551 file_util()->GetFileInfo(GetOperationContext().get(), url, | 551 file_util()->GetFileInfo(GetOperationContext().get(), url, |
552 &info, &platform_path)); | 552 &info, &platform_path)); |
553 EXPECT_EQ(999, info.size); | 553 EXPECT_EQ(999, info.size); |
554 } | 554 } |
555 } | 555 } |
556 | 556 |
557 } // namespace content | 557 } // namespace content |
OLD | NEW |