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/drive_backend/metadata_database.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 bool tracker_only; | 46 bool tracker_only; |
47 | 47 |
48 TrackedFile() : should_be_absent(false), tracker_only(false) {} | 48 TrackedFile() : should_be_absent(false), tracker_only(false) {} |
49 }; | 49 }; |
50 | 50 |
51 void ExpectEquivalent(const ServiceMetadata* left, | 51 void ExpectEquivalent(const ServiceMetadata* left, |
52 const ServiceMetadata* right) { | 52 const ServiceMetadata* right) { |
53 test_util::ExpectEquivalentServiceMetadata(*left, *right); | 53 test_util::ExpectEquivalentServiceMetadata(*left, *right); |
54 } | 54 } |
55 | 55 |
56 void ExpectEquivalent(const FileDetails* left, const FileDetails* right) { | |
57 if (!left) { | |
58 ASSERT_FALSE(right); | |
59 return; | |
60 } | |
61 ASSERT_TRUE(right); | |
62 test_util::ExpectEquivalentDetails(*left, *right); | |
63 } | |
64 | |
65 void ExpectEquivalent(const FileMetadata* left, const FileMetadata* right) { | 56 void ExpectEquivalent(const FileMetadata* left, const FileMetadata* right) { |
66 if (!left) { | 57 if (!left) { |
67 ASSERT_FALSE(right); | 58 ASSERT_FALSE(right); |
68 return; | 59 return; |
69 } | 60 } |
70 ASSERT_TRUE(right); | 61 ASSERT_TRUE(right); |
71 test_util::ExpectEquivalentMetadata(*left, *right); | 62 test_util::ExpectEquivalentMetadata(*left, *right); |
72 } | 63 } |
73 | 64 |
74 void ExpectEquivalent(const FileTracker* left, const FileTracker* right) { | 65 void ExpectEquivalent(const FileTracker* left, const FileTracker* right) { |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 ResetTrackerID(&sync_root.tracker); | 964 ResetTrackerID(&sync_root.tracker); |
974 ResetTrackerID(&app_root.tracker); | 965 ResetTrackerID(&app_root.tracker); |
975 app_root.tracker.set_parent_tracker_id(sync_root.tracker.tracker_id()); | 966 app_root.tracker.set_parent_tracker_id(sync_root.tracker.tracker_id()); |
976 | 967 |
977 VerifyTrackedFiles(tracked_files, arraysize(tracked_files)); | 968 VerifyTrackedFiles(tracked_files, arraysize(tracked_files)); |
978 VerifyReloadConsistency(); | 969 VerifyReloadConsistency(); |
979 } | 970 } |
980 | 971 |
981 } // namespace drive_backend | 972 } // namespace drive_backend |
982 } // namespace sync_file_system | 973 } // namespace sync_file_system |
OLD | NEW |