OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/stringprintf.h" | 5 #include "base/stringprintf.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/autofill/autofill_common_test.h" | 7 #include "chrome/browser/autofill/autofill_common_test.h" |
8 #include "chrome/browser/autofill/autofill_profile.h" | 8 #include "chrome/browser/autofill/autofill_profile.h" |
9 #include "chrome/browser/sync/profile_sync_service_harness.h" | 9 #include "chrome/browser/sync/profile_sync_service_harness.h" |
10 #include "chrome/browser/sync/test/integration/autofill_helper.h" | 10 #include "chrome/browser/sync/test/integration/autofill_helper.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 SetProfiles(profile, &autofill_profiles); | 93 SetProfiles(profile, &autofill_profiles); |
94 } | 94 } |
95 | 95 |
96 void AutofillSyncPerfTest::UpdateProfiles(int profile) { | 96 void AutofillSyncPerfTest::UpdateProfiles(int profile) { |
97 const std::vector<AutofillProfile*>& all_profiles = | 97 const std::vector<AutofillProfile*>& all_profiles = |
98 GetAllProfiles(profile); | 98 GetAllProfiles(profile); |
99 std::vector<AutofillProfile> autofill_profiles; | 99 std::vector<AutofillProfile> autofill_profiles; |
100 for (size_t i = 0; i < all_profiles.size(); ++i) { | 100 for (size_t i = 0; i < all_profiles.size(); ++i) { |
101 autofill_profiles.push_back(*all_profiles[i]); | 101 autofill_profiles.push_back(*all_profiles[i]); |
102 autofill_profiles.back().SetInfo(AutofillFieldType(NAME_FIRST), | 102 autofill_profiles.back().SetRawInfo(AutofillFieldType(NAME_FIRST), |
103 UTF8ToUTF16(NextName())); | 103 UTF8ToUTF16(NextName())); |
104 } | 104 } |
105 SetProfiles(profile, &autofill_profiles); | 105 SetProfiles(profile, &autofill_profiles); |
106 } | 106 } |
107 | 107 |
108 void AutofillSyncPerfTest::RemoveProfiles(int profile) { | 108 void AutofillSyncPerfTest::RemoveProfiles(int profile) { |
109 std::vector<AutofillProfile> empty; | 109 std::vector<AutofillProfile> empty; |
110 SetProfiles(profile, &empty); | 110 SetProfiles(profile, &empty); |
111 } | 111 } |
112 | 112 |
113 void AutofillSyncPerfTest::AddKeys(int profile, int num_keys) { | 113 void AutofillSyncPerfTest::AddKeys(int profile, int num_keys) { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 ASSERT_EQ(kNumKeys, GetKeyCount(1)); | 197 ASSERT_EQ(kNumKeys, GetKeyCount(1)); |
198 SyncTimingHelper::PrintResult("autofill", "add_autofill_keys", dt); | 198 SyncTimingHelper::PrintResult("autofill", "add_autofill_keys", dt); |
199 | 199 |
200 RemoveKeys(0); | 200 RemoveKeys(0); |
201 // TODO(lipalani): fix this. The following line is added to force sync. | 201 // TODO(lipalani): fix this. The following line is added to force sync. |
202 ForceSync(0); | 202 ForceSync(0); |
203 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 203 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
204 ASSERT_EQ(0, GetKeyCount(1)); | 204 ASSERT_EQ(0, GetKeyCount(1)); |
205 SyncTimingHelper::PrintResult("autofill", "delete_autofill_keys", dt); | 205 SyncTimingHelper::PrintResult("autofill", "delete_autofill_keys", dt); |
206 } | 206 } |
OLD | NEW |