| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_ | 5 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_ |
| 6 #define CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_ | 6 #define CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 const AutoFillProfiles& profiles) { | 264 const AutoFillProfiles& profiles) { |
| 265 std::map<string16, AutoFillProfile> expected_profiles_map; | 265 std::map<string16, AutoFillProfile> expected_profiles_map; |
| 266 for (size_t i = 0; i < expected_profiles.size(); ++i) { | 266 for (size_t i = 0; i < expected_profiles.size(); ++i) { |
| 267 const AutoFillProfile* p = expected_profiles[i]; | 267 const AutoFillProfile* p = expected_profiles[i]; |
| 268 expected_profiles_map[p->Label()] = *p; | 268 expected_profiles_map[p->Label()] = *p; |
| 269 } | 269 } |
| 270 | 270 |
| 271 for (size_t i = 0; i < profiles.size(); ++i) { | 271 for (size_t i = 0; i < profiles.size(); ++i) { |
| 272 const AutoFillProfile* p = profiles[i]; | 272 const AutoFillProfile* p = profiles[i]; |
| 273 if (!expected_profiles_map.count(p->Label())) { | 273 if (!expected_profiles_map.count(p->Label())) { |
| 274 LOG(INFO) << "Label " << p->Label() << " not in expected"; | 274 VLOG(1) << "Label " << p->Label() << " not in expected"; |
| 275 return false; | 275 return false; |
| 276 } | 276 } |
| 277 AutoFillProfile* expected_profile = &expected_profiles_map[p->Label()]; | 277 AutoFillProfile* expected_profile = &expected_profiles_map[p->Label()]; |
| 278 expected_profile->set_unique_id(p->unique_id()); | 278 expected_profile->set_unique_id(p->unique_id()); |
| 279 if (*expected_profile != *p) { | 279 if (*expected_profile != *p) { |
| 280 LOG(INFO) << "Profile mismatch"; | 280 VLOG(1) << "Profile mismatch"; |
| 281 return false; | 281 return false; |
| 282 } | 282 } |
| 283 expected_profiles_map.erase(p->Label()); | 283 expected_profiles_map.erase(p->Label()); |
| 284 } | 284 } |
| 285 | 285 |
| 286 if (expected_profiles_map.size()) { | 286 if (expected_profiles_map.size()) { |
| 287 LOG(INFO) << "Labels in expected but not supplied"; | 287 VLOG(1) << "Labels in expected but not supplied"; |
| 288 return false; | 288 return false; |
| 289 } | 289 } |
| 290 | 290 |
| 291 return true; | 291 return true; |
| 292 } | 292 } |
| 293 | 293 |
| 294 private: | 294 private: |
| 295 DISALLOW_COPY_AND_ASSIGN(LiveAutofillSyncTest); | 295 DISALLOW_COPY_AND_ASSIGN(LiveAutofillSyncTest); |
| 296 }; | 296 }; |
| 297 | 297 |
| 298 class TwoClientLiveAutofillSyncTest : public LiveAutofillSyncTest { | 298 class TwoClientLiveAutofillSyncTest : public LiveAutofillSyncTest { |
| 299 public: | 299 public: |
| 300 TwoClientLiveAutofillSyncTest() : LiveAutofillSyncTest(TWO_CLIENT) {} | 300 TwoClientLiveAutofillSyncTest() : LiveAutofillSyncTest(TWO_CLIENT) {} |
| 301 ~TwoClientLiveAutofillSyncTest() {} | 301 ~TwoClientLiveAutofillSyncTest() {} |
| 302 | 302 |
| 303 private: | 303 private: |
| 304 DISALLOW_COPY_AND_ASSIGN(TwoClientLiveAutofillSyncTest); | 304 DISALLOW_COPY_AND_ASSIGN(TwoClientLiveAutofillSyncTest); |
| 305 }; | 305 }; |
| 306 | 306 |
| 307 #endif // CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_ | 307 #endif // CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_ |
| OLD | NEW |