| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 mock_free_disk_space_checker_ = new StrictMock<MockFreeDiskSpaceGetter>; | 231 mock_free_disk_space_checker_ = new StrictMock<MockFreeDiskSpaceGetter>; |
| 232 SetFreeDiskSpaceGetterForTesting(mock_free_disk_space_checker_); | 232 SetFreeDiskSpaceGetterForTesting(mock_free_disk_space_checker_); |
| 233 | 233 |
| 234 scoped_refptr<base::SequencedWorkerPool> pool = | 234 scoped_refptr<base::SequencedWorkerPool> pool = |
| 235 content::BrowserThread::GetBlockingPool(); | 235 content::BrowserThread::GetBlockingPool(); |
| 236 blocking_task_runner_ = | 236 blocking_task_runner_ = |
| 237 pool->GetSequencedTaskRunner(pool->GetSequenceToken()); | 237 pool->GetSequencedTaskRunner(pool->GetSequenceToken()); |
| 238 | 238 |
| 239 cache_ = GDataCache::CreateGDataCacheOnUIThread( | 239 cache_ = GDataCache::CreateGDataCacheOnUIThread( |
| 240 GDataCache::GetCacheRootPath(profile_.get()), blocking_task_runner_); | 240 GDataCache::GetCacheRootPath(profile_.get()), blocking_task_runner_); |
| 241 cache_->ForceMetadataMapForTesting(); |
| 241 | 242 |
| 242 mock_uploader_.reset(new StrictMock<MockGDataUploader>); | 243 mock_uploader_.reset(new StrictMock<MockGDataUploader>); |
| 243 mock_webapps_registry_.reset(new StrictMock<MockDriveWebAppsRegistry>); | 244 mock_webapps_registry_.reset(new StrictMock<MockDriveWebAppsRegistry>); |
| 244 | 245 |
| 245 ASSERT_FALSE(file_system_); | 246 ASSERT_FALSE(file_system_); |
| 246 file_system_ = new GDataFileSystem(profile_.get(), | 247 file_system_ = new GDataFileSystem(profile_.get(), |
| 247 cache_, | 248 cache_, |
| 248 mock_doc_service_, | 249 mock_doc_service_, |
| 249 mock_uploader_.get(), | 250 mock_uploader_.get(), |
| 250 mock_webapps_registry_.get(), | 251 mock_webapps_registry_.get(), |
| (...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 | 2619 |
| 2619 // Try to close the same file twice. | 2620 // Try to close the same file twice. |
| 2620 file_system_->CloseFile(kFileInRoot, close_file_callback); | 2621 file_system_->CloseFile(kFileInRoot, close_file_callback); |
| 2621 message_loop_.Run(); | 2622 message_loop_.Run(); |
| 2622 | 2623 |
| 2623 // It must fail. | 2624 // It must fail. |
| 2624 EXPECT_EQ(GDATA_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_); | 2625 EXPECT_EQ(GDATA_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_); |
| 2625 } | 2626 } |
| 2626 | 2627 |
| 2627 } // namespace gdata | 2628 } // namespace gdata |
| OLD | NEW |