Index: chrome/test/live_sync/performance/autofill_sync_perf_test.cc |
diff --git a/chrome/test/live_sync/performance/autofill_sync_perf_test.cc b/chrome/test/live_sync/performance/autofill_sync_perf_test.cc |
index 685d7c44a4f3bba00ece89ae872b7f83f166cb1d..a8d28c30d4e9cb99dcfa9118e6de193cd948ca07 100644 |
--- a/chrome/test/live_sync/performance/autofill_sync_perf_test.cc |
+++ b/chrome/test/live_sync/performance/autofill_sync_perf_test.cc |
@@ -6,7 +6,8 @@ |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/autofill/autofill_common_test.h" |
#include "chrome/browser/sync/profile_sync_service_harness.h" |
-#include "chrome/test/live_sync/live_autofill_sync_test.h" |
+#include "chrome/test/live_sync/autofill_helper.h" |
+#include "chrome/test/live_sync/live_sync_test.h" |
#include "chrome/test/live_sync/performance/sync_timing_helper.h" |
// TODO(braffert): Move kNumBenchmarkPoints and kBenchmarkPoints for all |
@@ -17,9 +18,12 @@ static const int kBenchmarkPoints[] = {1, 10, 20, 30, 40, 50, 75, 100, 125, |
150, 175, 200, 225, 250, 300, 350, 400, |
500}; |
-class AutofillSyncPerfTest : public TwoClientLiveAutofillSyncTest { |
+class AutofillSyncPerfTest : public LiveSyncTest { |
public: |
- AutofillSyncPerfTest() : guid_number_(0), name_number_(0) {} |
+ AutofillSyncPerfTest() |
+ : LiveSyncTest(TWO_CLIENT), |
+ guid_number_(0), |
+ name_number_(0) {} |
// Adds |num_profiles| new autofill profiles to the sync profile |profile|. |
void AddProfiles(int profile, int num_profiles); |
@@ -55,9 +59,9 @@ class AutofillSyncPerfTest : public TwoClientLiveAutofillSyncTest { |
DISALLOW_COPY_AND_ASSIGN(AutofillSyncPerfTest); |
}; |
-void AutofillSyncPerfTest::AddProfiles(int profile, |
- int num_profiles) { |
- const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); |
+void AutofillSyncPerfTest::AddProfiles(int profile, int num_profiles) { |
+ const std::vector<AutofillProfile*>& all_profiles = |
+ AutofillHelper::GetAllProfiles(profile); |
std::vector<AutofillProfile> autofill_profiles; |
for (size_t i = 0; i < all_profiles.size(); ++i) { |
autofill_profiles.push_back(*all_profiles[i]); |
@@ -65,23 +69,24 @@ void AutofillSyncPerfTest::AddProfiles(int profile, |
for (int i = 0; i < num_profiles; ++i) { |
autofill_profiles.push_back(NextAutofillProfile()); |
} |
- SetProfiles(profile, &autofill_profiles); |
+ AutofillHelper::SetProfiles(profile, &autofill_profiles); |
} |
void AutofillSyncPerfTest::UpdateProfiles(int profile) { |
- const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); |
+ const std::vector<AutofillProfile*>& all_profiles = |
+ AutofillHelper::GetAllProfiles(profile); |
std::vector<AutofillProfile> autofill_profiles; |
for (size_t i = 0; i < all_profiles.size(); ++i) { |
autofill_profiles.push_back(*all_profiles[i]); |
autofill_profiles.back().SetInfo(AutofillFieldType(NAME_FIRST), |
UTF8ToUTF16(NextName())); |
} |
- SetProfiles(profile, &autofill_profiles); |
+ AutofillHelper::SetProfiles(profile, &autofill_profiles); |
} |
void AutofillSyncPerfTest::RemoveProfiles(int profile) { |
std::vector<AutofillProfile> empty; |
- SetProfiles(profile, &empty); |
+ AutofillHelper::SetProfiles(profile, &empty); |
} |
void AutofillSyncPerfTest::Cleanup() { |
@@ -122,19 +127,19 @@ IN_PROC_BROWSER_TEST_F(AutofillSyncPerfTest, P0) { |
AddProfiles(0, kNumProfiles); |
base::TimeDelta dt = |
SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
- ASSERT_EQ(kNumProfiles, GetProfileCount(1)); |
+ ASSERT_EQ(kNumProfiles, AutofillHelper::GetProfileCount(1)); |
SyncTimingHelper::PrintResult("autofill", "add", dt); |
// TCM ID - 7549835. |
UpdateProfiles(0); |
dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
- ASSERT_EQ(kNumProfiles, GetProfileCount(1)); |
+ ASSERT_EQ(kNumProfiles, AutofillHelper::GetProfileCount(1)); |
SyncTimingHelper::PrintResult("autofill", "update", dt); |
// TCM ID - 7553678. |
RemoveProfiles(0); |
dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
- ASSERT_EQ(0, GetProfileCount(1)); |
+ ASSERT_EQ(0, AutofillHelper::GetProfileCount(1)); |
SyncTimingHelper::PrintResult("autofill", "delete", dt); |
} |
@@ -146,24 +151,24 @@ IN_PROC_BROWSER_TEST_F(AutofillSyncPerfTest, DISABLED_Benchmark) { |
AddProfiles(0, num_profiles); |
base::TimeDelta dt_add = |
SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
- ASSERT_EQ(num_profiles, GetProfileCount(0)); |
- ASSERT_TRUE(AllProfilesMatch()); |
+ ASSERT_EQ(num_profiles, AutofillHelper::GetProfileCount(0)); |
+ ASSERT_TRUE(AutofillHelper::AllProfilesMatch()); |
VLOG(0) << std::endl << "Add: " << num_profiles << " " |
<< dt_add.InSecondsF(); |
UpdateProfiles(0); |
base::TimeDelta dt_update = |
SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
- ASSERT_EQ(num_profiles, GetProfileCount(0)); |
- ASSERT_TRUE(AllProfilesMatch()); |
+ ASSERT_EQ(num_profiles, AutofillHelper::GetProfileCount(0)); |
+ ASSERT_TRUE(AutofillHelper::AllProfilesMatch()); |
VLOG(0) << std::endl << "Update: " << num_profiles << " " |
<< dt_update.InSecondsF(); |
RemoveProfiles(0); |
base::TimeDelta dt_delete = |
SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
- ASSERT_EQ(0, GetProfileCount(0)); |
- ASSERT_TRUE(AllProfilesMatch()); |
+ ASSERT_EQ(0, AutofillHelper::GetProfileCount(0)); |
+ ASSERT_TRUE(AutofillHelper::AllProfilesMatch()); |
VLOG(0) << std::endl << "Delete: " << num_profiles << " " |
<< dt_delete.InSecondsF(); |