Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/metadata_database_unittest.cc

Issue 1099383002: Change ScopedPtrHashMap's 2nd template parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 template <typename Key, typename Value> 98 template <typename Key, typename Value>
99 void ExpectEquivalent(const base::hash_map<Key, Value>& left, 99 void ExpectEquivalent(const base::hash_map<Key, Value>& left,
100 const base::hash_map<Key, Value>& right) { 100 const base::hash_map<Key, Value>& right) {
101 ExpectEquivalentMaps(std::map<Key, Value>(left.begin(), left.end()), 101 ExpectEquivalentMaps(std::map<Key, Value>(left.begin(), left.end()),
102 std::map<Key, Value>(right.begin(), right.end())); 102 std::map<Key, Value>(right.begin(), right.end()));
103 } 103 }
104 104
105 template <typename Key, typename Value> 105 template <typename Key, typename Value>
106 void ExpectEquivalent(const base::ScopedPtrHashMap<Key, Value>& left, 106 void ExpectEquivalent(
107 const base::ScopedPtrHashMap<Key, Value>& right) { 107 const base::ScopedPtrHashMap<Key, scoped_ptr<Value>>& left,
108 const base::ScopedPtrHashMap<Key, scoped_ptr<Value>>& right) {
108 ExpectEquivalentMaps(std::map<Key, Value*>(left.begin(), left.end()), 109 ExpectEquivalentMaps(std::map<Key, Value*>(left.begin(), left.end()),
109 std::map<Key, Value*>(right.begin(), right.end())); 110 std::map<Key, Value*>(right.begin(), right.end()));
110 } 111 }
111 112
112 template <typename Container> 113 template <typename Container>
113 void ExpectEquivalentSets(const Container& left, const Container& right); 114 void ExpectEquivalentSets(const Container& left, const Container& right);
114 115
115 template <typename Value, typename Comparator> 116 template <typename Value, typename Comparator>
116 void ExpectEquivalent(const std::set<Value, Comparator>& left, 117 void ExpectEquivalent(const std::set<Value, Comparator>& left,
117 const std::set<Value, Comparator>& right) { 118 const std::set<Value, Comparator>& right) {
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 EXPECT_TRUE(file->HasKey("details")); 1151 EXPECT_TRUE(file->HasKey("details"));
1151 1152
1152 ASSERT_TRUE(files->GetDictionary(1, &file)); 1153 ASSERT_TRUE(files->GetDictionary(1, &file));
1153 EXPECT_TRUE(file->GetString("title", &str) && str == "file_0"); 1154 EXPECT_TRUE(file->GetString("title", &str) && str == "file_0");
1154 EXPECT_TRUE(file->GetString("type", &str) && str == "file"); 1155 EXPECT_TRUE(file->GetString("type", &str) && str == "file");
1155 EXPECT_TRUE(file->HasKey("details")); 1156 EXPECT_TRUE(file->HasKey("details"));
1156 } 1157 }
1157 1158
1158 } // namespace drive_backend 1159 } // namespace drive_backend
1159 } // namespace sync_file_system 1160 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698