| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/live_sync/autofill_helper.h" | 10 #include "chrome/browser/sync/test/integration/autofill_helper.h" |
| 11 #include "chrome/browser/sync/test/live_sync/live_sync_test.h" | 11 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" |
| 12 #include "chrome/browser/sync/test/live_sync/performance/sync_timing_helper.h" | 12 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 13 #include "chrome/browser/webdata/autofill_entry.h" | 13 #include "chrome/browser/webdata/autofill_entry.h" |
| 14 | 14 |
| 15 using autofill_helper::AllProfilesMatch; | 15 using autofill_helper::AllProfilesMatch; |
| 16 using autofill_helper::GetAllKeys; | 16 using autofill_helper::GetAllKeys; |
| 17 using autofill_helper::GetAllProfiles; | 17 using autofill_helper::GetAllProfiles; |
| 18 using autofill_helper::GetKeyCount; | 18 using autofill_helper::GetKeyCount; |
| 19 using autofill_helper::GetProfileCount; | 19 using autofill_helper::GetProfileCount; |
| 20 using autofill_helper::RemoveKey; | 20 using autofill_helper::RemoveKey; |
| 21 using autofill_helper::SetProfiles; | 21 using autofill_helper::SetProfiles; |
| 22 | 22 |
| 23 static const int kNumKeys = 150; | 23 static const int kNumKeys = 150; |
| 24 static const int kNumProfiles = 150; | 24 static const int kNumProfiles = 150; |
| 25 | 25 |
| 26 class AutofillSyncPerfTest : public LiveSyncTest { | 26 class AutofillSyncPerfTest : public SyncTest { |
| 27 public: | 27 public: |
| 28 AutofillSyncPerfTest() | 28 AutofillSyncPerfTest() |
| 29 : LiveSyncTest(TWO_CLIENT), | 29 : SyncTest(TWO_CLIENT), |
| 30 guid_number_(0), | 30 guid_number_(0), |
| 31 name_number_(0), | 31 name_number_(0), |
| 32 value_number_(0) {} | 32 value_number_(0) {} |
| 33 | 33 |
| 34 // Adds |num_profiles| new autofill profiles to the sync profile |profile|. | 34 // Adds |num_profiles| new autofill profiles to the sync profile |profile|. |
| 35 void AddProfiles(int profile, int num_profiles); | 35 void AddProfiles(int profile, int num_profiles); |
| 36 | 36 |
| 37 // Updates all autofill profiles for the sync profile |profile|. | 37 // Updates all autofill profiles for the sync profile |profile|. |
| 38 void UpdateProfiles(int profile); | 38 void UpdateProfiles(int profile); |
| 39 | 39 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 base::TimeDelta dt = | 189 base::TimeDelta dt = |
| 190 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 190 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 191 ASSERT_EQ(kNumKeys, GetKeyCount(1)); | 191 ASSERT_EQ(kNumKeys, GetKeyCount(1)); |
| 192 SyncTimingHelper::PrintResult("autofill", "add_autofill_keys", dt); | 192 SyncTimingHelper::PrintResult("autofill", "add_autofill_keys", dt); |
| 193 | 193 |
| 194 RemoveKeys(0); | 194 RemoveKeys(0); |
| 195 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 195 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 196 ASSERT_EQ(0, GetKeyCount(1)); | 196 ASSERT_EQ(0, GetKeyCount(1)); |
| 197 SyncTimingHelper::PrintResult("autofill", "delete_autofill_keys", dt); | 197 SyncTimingHelper::PrintResult("autofill", "delete_autofill_keys", dt); |
| 198 } | 198 } |
| OLD | NEW |