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 "chrome/browser/chromeos/drive/file_system/operation_test_base.h" | 7 #include "chrome/browser/chromeos/drive/file_system/operation_test_base.h" |
8 #include "google_apis/drive/test_util.h" | 8 #include "google_apis/drive/test_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 FileError error = FILE_ERROR_FAILED; | 43 FileError error = FILE_ERROR_FAILED; |
44 operation.CreateDirectory( | 44 operation.CreateDirectory( |
45 kNewDirectory1, | 45 kNewDirectory1, |
46 true, // is_exclusive | 46 true, // is_exclusive |
47 false, // is_recursive | 47 false, // is_recursive |
48 google_apis::test_util::CreateCopyResultCallback(&error)); | 48 google_apis::test_util::CreateCopyResultCallback(&error)); |
49 test_util::RunBlockingPoolTask(); | 49 test_util::RunBlockingPoolTask(); |
50 EXPECT_EQ(FILE_ERROR_OK, error); | 50 EXPECT_EQ(FILE_ERROR_OK, error); |
51 EXPECT_EQ(FILE_ERROR_OK, FindDirectory(kNewDirectory1)); | 51 EXPECT_EQ(FILE_ERROR_OK, FindDirectory(kNewDirectory1)); |
52 EXPECT_EQ(1U, observer()->get_changed_paths().size()); | 52 EXPECT_EQ(1U, observer()->get_changed_files().size()); |
53 EXPECT_EQ(1U, | 53 EXPECT_EQ( |
54 observer()->get_changed_paths().count(kNewDirectory1.DirName())); | 54 1U, |
| 55 observer()->get_changed_files().CountDirectory(kNewDirectory1.DirName())); |
55 | 56 |
56 ResourceEntry entry; | 57 ResourceEntry entry; |
57 EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(kNewDirectory1, &entry)); | 58 EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(kNewDirectory1, &entry)); |
58 EXPECT_EQ(ResourceEntry::DIRTY, entry.metadata_edit_state()); | 59 EXPECT_EQ(ResourceEntry::DIRTY, entry.metadata_edit_state()); |
59 EXPECT_TRUE(entry.file_info().is_directory()); | 60 EXPECT_TRUE(entry.file_info().is_directory()); |
60 EXPECT_FALSE(base::Time::FromInternalValue( | 61 EXPECT_FALSE(base::Time::FromInternalValue( |
61 entry.file_info().last_modified()).is_null()); | 62 entry.file_info().last_modified()).is_null()); |
62 EXPECT_FALSE(base::Time::FromInternalValue( | 63 EXPECT_FALSE(base::Time::FromInternalValue( |
63 entry.file_info().last_accessed()).is_null()); | 64 entry.file_info().last_accessed()).is_null()); |
64 EXPECT_EQ(1U, observer()->updated_local_ids().size()); | 65 EXPECT_EQ(1U, observer()->updated_local_ids().size()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 kExistingFile.AppendASCII("New Directory"), | 116 kExistingFile.AppendASCII("New Directory"), |
116 false, // is_exclusive | 117 false, // is_exclusive |
117 true, // is_recursive | 118 true, // is_recursive |
118 google_apis::test_util::CreateCopyResultCallback(&error)); | 119 google_apis::test_util::CreateCopyResultCallback(&error)); |
119 test_util::RunBlockingPoolTask(); | 120 test_util::RunBlockingPoolTask(); |
120 EXPECT_EQ(FILE_ERROR_NOT_A_DIRECTORY, error); | 121 EXPECT_EQ(FILE_ERROR_NOT_A_DIRECTORY, error); |
121 } | 122 } |
122 | 123 |
123 } // namespace file_system | 124 } // namespace file_system |
124 } // namespace drive | 125 } // namespace drive |
OLD | NEW |