| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/drive/file_system/create_directory_operation.h
" | 5 #include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h
" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system_util.h" | 9 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 10 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 10 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 PlatformFileInfoProto* file_info = entry.mutable_file_info(); | 32 PlatformFileInfoProto* file_info = entry.mutable_file_info(); |
| 33 file_info->set_is_directory(is_directory); | 33 file_info->set_is_directory(is_directory); |
| 34 | 34 |
| 35 return entry; | 35 return entry; |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 TEST(CreateDirectoryOperationTest, GetExistingDeepestDirectory) { | 40 TEST(CreateDirectoryOperationTest, GetExistingDeepestDirectory) { |
| 41 MessageLoopForUI message_loop; | 41 base::MessageLoopForUI message_loop; |
| 42 content::TestBrowserThread ui_thread( | 42 content::TestBrowserThread ui_thread( |
| 43 content::BrowserThread::UI, &message_loop); | 43 content::BrowserThread::UI, &message_loop); |
| 44 | 44 |
| 45 // Set up a Metadata instance. | 45 // Set up a Metadata instance. |
| 46 base::ScopedTempDir temp_dir; | 46 base::ScopedTempDir temp_dir; |
| 47 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 47 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 48 scoped_ptr<internal::ResourceMetadata, test_util::DestroyHelperForTests> | 48 scoped_ptr<internal::ResourceMetadata, test_util::DestroyHelperForTests> |
| 49 metadata(new internal::ResourceMetadata( | 49 metadata(new internal::ResourceMetadata( |
| 50 temp_dir.path(), message_loop.message_loop_proxy())); | 50 temp_dir.path(), message_loop.message_loop_proxy())); |
| 51 FileError error = FILE_ERROR_FAILED; | 51 FileError error = FILE_ERROR_FAILED; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 EXPECT_EQ( | 166 EXPECT_EQ( |
| 167 FILE_PATH_LITERAL(""), | 167 FILE_PATH_LITERAL(""), |
| 168 CreateDirectoryOperation::GetExistingDeepestDirectory( | 168 CreateDirectoryOperation::GetExistingDeepestDirectory( |
| 169 metadata.get(), | 169 metadata.get(), |
| 170 base::FilePath(FILE_PATH_LITERAL("foo/bar")), | 170 base::FilePath(FILE_PATH_LITERAL("foo/bar")), |
| 171 &entry).value()); | 171 &entry).value()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace file_system | 174 } // namespace file_system |
| 175 } // namespace drive | 175 } // namespace drive |
| OLD | NEW |