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/recursive_operation_delegate.h" | 5 #include "storage/browser/fileapi/recursive_operation_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 return; | 121 return; |
122 } | 122 } |
123 | 123 |
124 operation->Cancel(); | 124 operation->Cancel(); |
125 } | 125 } |
126 | 126 |
127 } // namespace | 127 } // namespace |
128 | 128 |
129 class RecursiveOperationDelegateTest : public testing::Test { | 129 class RecursiveOperationDelegateTest : public testing::Test { |
130 protected: | 130 protected: |
131 virtual void SetUp() override { | 131 void SetUp() override { |
132 EXPECT_TRUE(base_.CreateUniqueTempDir()); | 132 EXPECT_TRUE(base_.CreateUniqueTempDir()); |
133 sandbox_file_system_.SetUp(base_.path().AppendASCII("filesystem")); | 133 sandbox_file_system_.SetUp(base_.path().AppendASCII("filesystem")); |
134 } | 134 } |
135 | 135 |
136 virtual void TearDown() override { | 136 void TearDown() override { sandbox_file_system_.TearDown(); } |
137 sandbox_file_system_.TearDown(); | |
138 } | |
139 | 137 |
140 scoped_ptr<FileSystemOperationContext> NewContext() { | 138 scoped_ptr<FileSystemOperationContext> NewContext() { |
141 FileSystemOperationContext* context = | 139 FileSystemOperationContext* context = |
142 sandbox_file_system_.NewOperationContext(); | 140 sandbox_file_system_.NewOperationContext(); |
143 // Grant enough quota for all test cases. | 141 // Grant enough quota for all test cases. |
144 context->set_allowed_bytes_growth(1000000); | 142 context->set_allowed_bytes_growth(1000000); |
145 return make_scoped_ptr(context); | 143 return make_scoped_ptr(context); |
146 } | 144 } |
147 | 145 |
148 storage::FileSystemFileUtil* file_util() { | 146 storage::FileSystemFileUtil* file_util() { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 base::Bind(&ReportStatus, &error))); | 269 base::Bind(&ReportStatus, &error))); |
272 operation->RunRecursively(); | 270 operation->RunRecursively(); |
273 | 271 |
274 // Invoke Cancel(), after 5 times message posting. | 272 // Invoke Cancel(), after 5 times message posting. |
275 CallCancelLater(operation.get(), 5); | 273 CallCancelLater(operation.get(), 5); |
276 base::RunLoop().RunUntilIdle(); | 274 base::RunLoop().RunUntilIdle(); |
277 ASSERT_EQ(base::File::FILE_ERROR_ABORT, error); | 275 ASSERT_EQ(base::File::FILE_ERROR_ABORT, error); |
278 } | 276 } |
279 | 277 |
280 } // namespace content | 278 } // namespace content |
OLD | NEW |