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 "chrome/browser/chromeos/drive/resource_metadata.h" | 5 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 scoped_ptr<ResourceEntryVector> entries_in_other = | 853 scoped_ptr<ResourceEntryVector> entries_in_other = |
854 ReadDirectoryByPathSync(base::FilePath::FromUTF8Unsafe("drive/other")); | 854 ReadDirectoryByPathSync(base::FilePath::FromUTF8Unsafe("drive/other")); |
855 ASSERT_TRUE(entries_in_other.get()); | 855 ASSERT_TRUE(entries_in_other.get()); |
856 EXPECT_TRUE(entries_in_other->empty()); | 856 EXPECT_TRUE(entries_in_other->empty()); |
857 } | 857 } |
858 | 858 |
859 // Tests for methods running on the blocking task runner. | 859 // Tests for methods running on the blocking task runner. |
860 class ResourceMetadataTest : public testing::Test { | 860 class ResourceMetadataTest : public testing::Test { |
861 protected: | 861 protected: |
862 ResourceMetadataTest() | 862 ResourceMetadataTest() |
863 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 863 : ui_thread_(content::BrowserThread::UI, &message_loop_) {} |
864 resource_metadata_(NULL) {} | |
865 | 864 |
866 virtual void SetUp() OVERRIDE { | 865 virtual void SetUp() OVERRIDE { |
867 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 866 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
868 | 867 |
869 // Use the main thread as the blocking task runner. | 868 // Use the main thread as the blocking task runner. |
870 resource_metadata_.reset(new ResourceMetadata( | 869 resource_metadata_.reset(new ResourceMetadata( |
871 temp_dir_.path(), message_loop_.message_loop_proxy())); | 870 temp_dir_.path(), message_loop_.message_loop_proxy())); |
872 | 871 |
873 FileError error = FILE_ERROR_FAILED; | 872 FileError error = FILE_ERROR_FAILED; |
874 resource_metadata_->Initialize( | 873 resource_metadata_->Initialize( |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 else | 1086 else |
1088 ++directory_count; | 1087 ++directory_count; |
1089 } | 1088 } |
1090 | 1089 |
1091 EXPECT_EQ(7, file_count); | 1090 EXPECT_EQ(7, file_count); |
1092 EXPECT_EQ(6, directory_count); | 1091 EXPECT_EQ(6, directory_count); |
1093 } | 1092 } |
1094 | 1093 |
1095 } // namespace internal | 1094 } // namespace internal |
1096 } // namespace drive | 1095 } // namespace drive |
OLD | NEW |