drive: Check OperationObserver::OnEntryUpdatedByOperation is called by MoveOperation in tests

Both setting metadata_edit_state to DIRTY and calling OnEntryUpdateByOperation are necessary to trigger syncing.

BUG=260538
TEST=unit_tests --gtest_filter="MoveOperationTest.*"

Review URL: https://codereview.chromium.org/100373004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238366 0039d316-1c4b-4281-b951-d872f2087c98
parent 9cb0ff30
...@@ -59,6 +59,9 @@ TEST_F(MoveOperationTest, MoveFileInSameDirectory) { ...@@ -59,6 +59,9 @@ TEST_F(MoveOperationTest, MoveFileInSameDirectory) {
EXPECT_EQ(1U, observer()->get_changed_paths().size()); EXPECT_EQ(1U, observer()->get_changed_paths().size());
EXPECT_TRUE(observer()->get_changed_paths().count(src_path.DirName())); EXPECT_TRUE(observer()->get_changed_paths().count(src_path.DirName()));
EXPECT_EQ(1U, observer()->updated_local_ids().size());
EXPECT_TRUE(observer()->updated_local_ids().count(src_entry.local_id()));
} }
TEST_F(MoveOperationTest, MoveFileFromRootToSubDirectory) { TEST_F(MoveOperationTest, MoveFileFromRootToSubDirectory) {
...@@ -87,6 +90,9 @@ TEST_F(MoveOperationTest, MoveFileFromRootToSubDirectory) { ...@@ -87,6 +90,9 @@ TEST_F(MoveOperationTest, MoveFileFromRootToSubDirectory) {
EXPECT_EQ(2U, observer()->get_changed_paths().size()); EXPECT_EQ(2U, observer()->get_changed_paths().size());
EXPECT_TRUE(observer()->get_changed_paths().count(src_path.DirName())); EXPECT_TRUE(observer()->get_changed_paths().count(src_path.DirName()));
EXPECT_TRUE(observer()->get_changed_paths().count(dest_path.DirName())); EXPECT_TRUE(observer()->get_changed_paths().count(dest_path.DirName()));
EXPECT_EQ(1U, observer()->updated_local_ids().size());
EXPECT_TRUE(observer()->updated_local_ids().count(src_entry.local_id()));
} }
TEST_F(MoveOperationTest, MoveFileBetweenSubDirectoriesRenameWithTitle) { TEST_F(MoveOperationTest, MoveFileBetweenSubDirectoriesRenameWithTitle) {
...@@ -135,6 +141,9 @@ TEST_F(MoveOperationTest, MoveFileBetweenSubDirectoriesRenameWithTitle) { ...@@ -135,6 +141,9 @@ TEST_F(MoveOperationTest, MoveFileBetweenSubDirectoriesRenameWithTitle) {
EXPECT_EQ(2U, observer()->get_changed_paths().size()); EXPECT_EQ(2U, observer()->get_changed_paths().size());
EXPECT_TRUE(observer()->get_changed_paths().count(copied_path.DirName())); EXPECT_TRUE(observer()->get_changed_paths().count(copied_path.DirName()));
EXPECT_TRUE(observer()->get_changed_paths().count(dest_path.DirName())); EXPECT_TRUE(observer()->get_changed_paths().count(dest_path.DirName()));
EXPECT_EQ(1U, observer()->updated_local_ids().size());
EXPECT_TRUE(observer()->updated_local_ids().count(copied_entry.local_id()));
} }
TEST_F(MoveOperationTest, MoveNotExistingFile) { TEST_F(MoveOperationTest, MoveNotExistingFile) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment