OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/sync_file_system/local/local_file_change_tracker.h" | 5 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 // Make sure we have no in-memory changes in the tracker. | 558 // Make sure we have no in-memory changes in the tracker. |
559 file_system_.GetChangedURLsInTracker(&urls); | 559 file_system_.GetChangedURLsInTracker(&urls); |
560 ASSERT_EQ(0U, urls.size()); | 560 ASSERT_EQ(0U, urls.size()); |
561 | 561 |
562 RestoreChangesFromTrackerDB(); | 562 RestoreChangesFromTrackerDB(); |
563 | 563 |
564 // Make sure the changes are restored from the DB. | 564 // Make sure the changes are restored from the DB. |
565 file_system_.GetChangedURLsInTracker(&urls); | 565 file_system_.GetChangedURLsInTracker(&urls); |
566 // Deletion for child files in the deleted directory cannot be restored, | 566 // Deletion for child files in the deleted directory cannot be restored, |
567 // so we will only have 8 changes. | 567 // so we will only have 8 changes. |
568 EXPECT_EQ(8U, urls.size()); | 568 EXPECT_EQ(10U, urls.size()); |
569 | 569 |
570 VerifyAndClearChange(URL(kPath0), | 570 VerifyAndClearChange(URL(kPath0), |
571 FileChange(FileChange::FILE_CHANGE_DELETE, | 571 FileChange(FileChange::FILE_CHANGE_DELETE, |
572 sync_file_system::SYNC_FILE_TYPE_UNKNOWN)); | 572 sync_file_system::SYNC_FILE_TYPE_UNKNOWN)); |
573 VerifyAndClearChange(URL(kPath1), | 573 VerifyAndClearChange(URL(kPath1), |
574 FileChange(FileChange::FILE_CHANGE_DELETE, | 574 FileChange(FileChange::FILE_CHANGE_DELETE, |
575 sync_file_system::SYNC_FILE_TYPE_UNKNOWN)); | 575 sync_file_system::SYNC_FILE_TYPE_UNKNOWN)); |
576 VerifyAndClearChange(URL(kPath3), | 576 VerifyAndClearChange(URL(kPath3), |
577 FileChange(FileChange::FILE_CHANGE_DELETE, | 577 FileChange(FileChange::FILE_CHANGE_DELETE, |
578 sync_file_system::SYNC_FILE_TYPE_UNKNOWN)); | 578 sync_file_system::SYNC_FILE_TYPE_UNKNOWN)); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 | 705 |
706 // Make sure they're gone from the database too. | 706 // Make sure they're gone from the database too. |
707 DropChangesInTracker(); | 707 DropChangesInTracker(); |
708 RestoreChangesFromTrackerDB(); | 708 RestoreChangesFromTrackerDB(); |
709 | 709 |
710 GetAllChangedURLs(&urls); | 710 GetAllChangedURLs(&urls); |
711 EXPECT_TRUE(urls.empty()); | 711 EXPECT_TRUE(urls.empty()); |
712 } | 712 } |
713 | 713 |
714 } // namespace sync_file_system | 714 } // namespace sync_file_system |
OLD | NEW |