| OLD | NEW |
| 1 | 1 |
| 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/sync/test/integration/autofill_helper.h" | 8 #include "chrome/browser/sync/test/integration/autofill_helper.h" |
| 9 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 9 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| 10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, WebDataServiceSanity) { | 58 IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, WebDataServiceSanity) { |
| 59 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 59 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 60 | 60 |
| 61 // Client0 adds a key. | 61 // Client0 adds a key. |
| 62 std::set<AutofillKey> keys; | 62 std::set<AutofillKey> keys; |
| 63 keys.insert(AutofillKey("name0", "value0")); | 63 keys.insert(AutofillKey("name0", "value0")); |
| 64 AddKeys(0, keys); | 64 AddKeys(0, keys); |
| 65 ASSERT_TRUE(AutofillKeysChecker(0, 1).Wait()); | 65 ASSERT_TRUE(AutofillKeysChecker(0, 1).Wait()); |
| 66 ASSERT_EQ(1U, GetAllKeys(0).size()); | 66 ASSERT_EQ(1U, GetAllKeys(0).size()); |
| 67 | |
| 68 // Client1 adds a key. | 67 // Client1 adds a key. |
| 69 keys.clear(); | 68 keys.clear(); |
| 70 keys.insert(AutofillKey("name1", "value1-0")); | 69 keys.insert(AutofillKey("name1", "value1-0")); |
| 71 AddKeys(1, keys); | 70 AddKeys(1, keys); |
| 72 ASSERT_TRUE(AutofillKeysChecker(0, 1).Wait()); | 71 ASSERT_TRUE(AutofillKeysChecker(0, 1).Wait()); |
| 73 ASSERT_EQ(2U, GetAllKeys(0).size()); | 72 ASSERT_EQ(2U, GetAllKeys(0).size()); |
| 74 | 73 |
| 75 // Client0 adds a key with the same name. | 74 // Client0 adds a key with the same name. |
| 76 keys.clear(); | 75 keys.clear(); |
| 77 keys.insert(AutofillKey("name1", "value1-1")); | 76 keys.insert(AutofillKey("name1", "value1-1")); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 AddProfile(0, CreateUniqueAutofillProfile()); | 381 AddProfile(0, CreateUniqueAutofillProfile()); |
| 383 | 382 |
| 384 ASSERT_TRUE(AutofillProfileChecker(0, 1).Wait()); | 383 ASSERT_TRUE(AutofillProfileChecker(0, 1).Wait()); |
| 385 | 384 |
| 386 // Check that the total number of autofill profiles is as expected | 385 // Check that the total number of autofill profiles is as expected |
| 387 for (int i = 0; i < num_clients(); ++i) { | 386 for (int i = 0; i < num_clients(); ++i) { |
| 388 ASSERT_EQ(GetProfileCount(i), init_autofill_profiles_count + 1) << | 387 ASSERT_EQ(GetProfileCount(i), init_autofill_profiles_count + 1) << |
| 389 "Total autofill profile count is wrong."; | 388 "Total autofill profile count is wrong."; |
| 390 } | 389 } |
| 391 } | 390 } |
| OLD | NEW |