| 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/drive_file_system.h" | 5 #include "chrome/browser/chromeos/drive/drive_file_system.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 AddResourceToDirectory( | 1594 AddResourceToDirectory( |
| 1595 GURL(dest_parent_proto->content_url()), | 1595 GURL(dest_parent_proto->content_url()), |
| 1596 GURL(src_entry_proto->edit_url()), _)); | 1596 GURL(src_entry_proto->edit_url()), _)); |
| 1597 | 1597 |
| 1598 FileOperationCallback callback = | 1598 FileOperationCallback callback = |
| 1599 base::Bind(&CallbackHelper::FileOperationCallback, | 1599 base::Bind(&CallbackHelper::FileOperationCallback, |
| 1600 callback_helper_.get()); | 1600 callback_helper_.get()); |
| 1601 | 1601 |
| 1602 // Expect notification for both source and destination directories. | 1602 // Expect notification for both source and destination directories. |
| 1603 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( | 1603 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( |
| 1604 Eq(FilePath(FILE_PATH_LITERAL("drive"))))).Times(1); | 1604 Eq(FilePath(FILE_PATH_LITERAL("drive"))))).Times(2); |
| 1605 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( | 1605 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( |
| 1606 Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1); | 1606 Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1); |
| 1607 | 1607 |
| 1608 file_system_->Move(src_file_path, dest_file_path, callback); | 1608 file_system_->Move(src_file_path, dest_file_path, callback); |
| 1609 google_apis::test_util::RunBlockingPoolTask(); | 1609 google_apis::test_util::RunBlockingPoolTask(); |
| 1610 EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_); | 1610 EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_); |
| 1611 | 1611 |
| 1612 EXPECT_FALSE(EntryExists(src_file_path)); | 1612 EXPECT_FALSE(EntryExists(src_file_path)); |
| 1613 EXPECT_TRUE(EntryExists(dest_file_path)); | 1613 EXPECT_TRUE(EntryExists(dest_file_path)); |
| 1614 EXPECT_EQ(src_file_resource_id, GetResourceIdByPath(dest_file_path)); | 1614 EXPECT_EQ(src_file_resource_id, GetResourceIdByPath(dest_file_path)); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1644 RemoveResourceFromDirectory( | 1644 RemoveResourceFromDirectory( |
| 1645 GURL(src_parent_proto->content_url()), | 1645 GURL(src_parent_proto->content_url()), |
| 1646 src_file_resource_id, _)); | 1646 src_file_resource_id, _)); |
| 1647 | 1647 |
| 1648 FileOperationCallback callback = | 1648 FileOperationCallback callback = |
| 1649 base::Bind(&CallbackHelper::FileOperationCallback, | 1649 base::Bind(&CallbackHelper::FileOperationCallback, |
| 1650 callback_helper_.get()); | 1650 callback_helper_.get()); |
| 1651 | 1651 |
| 1652 // Expect notification for both source and destination directories. | 1652 // Expect notification for both source and destination directories. |
| 1653 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( | 1653 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( |
| 1654 Eq(FilePath(FILE_PATH_LITERAL("drive"))))).Times(1); | 1654 Eq(FilePath(FILE_PATH_LITERAL("drive"))))).Times(2); |
| 1655 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( | 1655 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( |
| 1656 Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1); | 1656 Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1); |
| 1657 | 1657 |
| 1658 file_system_->Move(src_file_path, dest_file_path, callback); | 1658 file_system_->Move(src_file_path, dest_file_path, callback); |
| 1659 google_apis::test_util::RunBlockingPoolTask(); | 1659 google_apis::test_util::RunBlockingPoolTask(); |
| 1660 EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_); | 1660 EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_); |
| 1661 | 1661 |
| 1662 EXPECT_FALSE(EntryExists(src_file_path)); | 1662 EXPECT_FALSE(EntryExists(src_file_path)); |
| 1663 ASSERT_TRUE(EntryExists(dest_file_path)); | 1663 ASSERT_TRUE(EntryExists(dest_file_path)); |
| 1664 EXPECT_EQ(src_file_resource_id, GetResourceIdByPath(dest_file_path)); | 1664 EXPECT_EQ(src_file_resource_id, GetResourceIdByPath(dest_file_path)); |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 | 2684 |
| 2685 // An app for foo.ext_1 should now be found, as the registry was loaded. | 2685 // An app for foo.ext_1 should now be found, as the registry was loaded. |
| 2686 drive_webapps_registry_->GetWebAppsForFile( | 2686 drive_webapps_registry_->GetWebAppsForFile( |
| 2687 FilePath(FILE_PATH_LITERAL("foo.ext_1")), | 2687 FilePath(FILE_PATH_LITERAL("foo.ext_1")), |
| 2688 "" /* mime_type */, | 2688 "" /* mime_type */, |
| 2689 &apps); | 2689 &apps); |
| 2690 EXPECT_EQ(1U, apps.size()); | 2690 EXPECT_EQ(1U, apps.size()); |
| 2691 } | 2691 } |
| 2692 | 2692 |
| 2693 } // namespace drive | 2693 } // namespace drive |
| OLD | NEW |