| 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/drive_backend_test_util.
h" | 5 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.
h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/drive/drive_api_util.h" | 10 #include "chrome/browser/drive/drive_api_util.h" |
| 11 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" | 11 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" |
| 12 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" | 12 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" |
| 13 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" | 13 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" |
| 14 #include "google_apis/drive/drive_api_parser.h" | 14 #include "google_apis/drive/drive_api_parser.h" |
| 15 #include "google_apis/drive/drive_entry_kinds.h" | 15 #include "google_apis/drive/drive_entry_kinds.h" |
| 16 #include "google_apis/drive/gdata_wapi_parser.h" | 16 #include "google_apis/drive/gdata_wapi_parser.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 namespace sync_file_system { | 19 namespace sync_file_system { |
| 20 namespace drive_backend { | 20 namespace drive_backend { |
| 21 namespace test_util { | 21 namespace test_util { |
| 22 | 22 |
| 23 void ExpectEquivalentServiceMetadata(const ServiceMetadata& left, | |
| 24 const ServiceMetadata& right) { | |
| 25 EXPECT_EQ(left.largest_change_id(), right.largest_change_id()); | |
| 26 EXPECT_EQ(left.sync_root_tracker_id(), right.sync_root_tracker_id()); | |
| 27 EXPECT_EQ(left.next_tracker_id(), right.next_tracker_id()); | |
| 28 } | |
| 29 | |
| 30 void ExpectEquivalentDetails(const FileDetails& left, | 23 void ExpectEquivalentDetails(const FileDetails& left, |
| 31 const FileDetails& right) { | 24 const FileDetails& right) { |
| 32 std::set<std::string> parents; | 25 std::set<std::string> parents; |
| 33 for (int i = 0; i < left.parent_folder_ids_size(); ++i) | 26 for (int i = 0; i < left.parent_folder_ids_size(); ++i) |
| 34 EXPECT_TRUE(parents.insert(left.parent_folder_ids(i)).second); | 27 EXPECT_TRUE(parents.insert(left.parent_folder_ids(i)).second); |
| 35 | 28 |
| 36 for (int i = 0; i < right.parent_folder_ids_size(); ++i) | 29 for (int i = 0; i < right.parent_folder_ids_size(); ++i) |
| 37 EXPECT_EQ(1u, parents.erase(left.parent_folder_ids(i))); | 30 EXPECT_EQ(1u, parents.erase(left.parent_folder_ids(i))); |
| 38 EXPECT_TRUE(parents.empty()); | 31 EXPECT_TRUE(parents.empty()); |
| 39 | 32 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 tracker->set_tracker_kind(TRACKER_KIND_REGULAR); | 122 tracker->set_tracker_kind(TRACKER_KIND_REGULAR); |
| 130 tracker->set_dirty(true); | 123 tracker->set_dirty(true); |
| 131 tracker->set_active(false); | 124 tracker->set_active(false); |
| 132 tracker->set_needs_folder_listing(false); | 125 tracker->set_needs_folder_listing(false); |
| 133 return tracker.Pass(); | 126 return tracker.Pass(); |
| 134 } | 127 } |
| 135 | 128 |
| 136 } // namespace test_util | 129 } // namespace test_util |
| 137 } // namespace drive_backend | 130 } // namespace drive_backend |
| 138 } // namespace sync_file_system | 131 } // namespace sync_file_system |
| OLD | NEW |