| 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/password_manager/password_store.h" | 7 #include "chrome/browser/password_manager/password_store.h" |
| 8 #include "chrome/browser/sync/profile_sync_service_harness.h" | 8 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 9 #include "chrome/test/live_sync/live_passwords_sync_test.h" | 9 #include "chrome/test/live_sync/live_passwords_sync_test.h" |
| 10 #include "chrome/test/live_sync/performance/sync_timing_helper.h" | 10 #include "chrome/test/live_sync/performance/sync_timing_helper.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 IN_PROC_BROWSER_TEST_F(PasswordsSyncPerfTest, P0) { | 84 IN_PROC_BROWSER_TEST_F(PasswordsSyncPerfTest, P0) { |
| 85 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 85 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 86 | 86 |
| 87 // TCM ID - 7367749. | 87 // TCM ID - 7367749. |
| 88 AddLogins(0, kNumPasswords); | 88 AddLogins(0, kNumPasswords); |
| 89 base::TimeDelta dt = | 89 base::TimeDelta dt = |
| 90 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 90 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 91 ASSERT_EQ(kNumPasswords, GetPasswordCount(1)); | 91 ASSERT_EQ(kNumPasswords, GetPasswordCount(1)); |
| 92 SyncTimingHelper::PrintResult("passwords", "add", dt); | 92 SyncTimingHelper::PrintResult("passwords", "add_passwords", dt); |
| 93 | 93 |
| 94 // TCM ID - 7365093. | 94 // TCM ID - 7365093. |
| 95 UpdateLogins(0); | 95 UpdateLogins(0); |
| 96 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 96 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 97 ASSERT_EQ(kNumPasswords, GetPasswordCount(1)); | 97 ASSERT_EQ(kNumPasswords, GetPasswordCount(1)); |
| 98 SyncTimingHelper::PrintResult("passwords", "update", dt); | 98 SyncTimingHelper::PrintResult("passwords", "update_passwords", dt); |
| 99 | 99 |
| 100 // TCM ID - 7557852 | 100 // TCM ID - 7557852 |
| 101 RemoveLogins(0); | 101 RemoveLogins(0); |
| 102 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 102 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 103 ASSERT_EQ(0, GetPasswordCount(1)); | 103 ASSERT_EQ(0, GetPasswordCount(1)); |
| 104 SyncTimingHelper::PrintResult("passwords", "delete", dt); | 104 SyncTimingHelper::PrintResult("passwords", "delete_passwords", dt); |
| 105 } | 105 } |
| 106 | 106 |
| 107 IN_PROC_BROWSER_TEST_F(PasswordsSyncPerfTest, DISABLED_Benchmark) { | 107 IN_PROC_BROWSER_TEST_F(PasswordsSyncPerfTest, DISABLED_Benchmark) { |
| 108 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 108 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 109 | 109 |
| 110 for (int i = 0; i < kNumBenchmarkPoints; ++i) { | 110 for (int i = 0; i < kNumBenchmarkPoints; ++i) { |
| 111 int num_passwords = kBenchmarkPoints[i]; | 111 int num_passwords = kBenchmarkPoints[i]; |
| 112 AddLogins(0, num_passwords); | 112 AddLogins(0, num_passwords); |
| 113 base::TimeDelta dt_add = | 113 base::TimeDelta dt_add = |
| 114 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 114 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 129 base::TimeDelta dt_delete = | 129 base::TimeDelta dt_delete = |
| 130 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 130 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 131 ASSERT_EQ(0, GetPasswordCount(0)); | 131 ASSERT_EQ(0, GetPasswordCount(0)); |
| 132 ASSERT_TRUE(AllProfilesContainSamePasswordForms()); | 132 ASSERT_TRUE(AllProfilesContainSamePasswordForms()); |
| 133 VLOG(0) << std::endl << "Delete: " << num_passwords << " " | 133 VLOG(0) << std::endl << "Delete: " << num_passwords << " " |
| 134 << dt_delete.InSecondsF(); | 134 << dt_delete.InSecondsF(); |
| 135 | 135 |
| 136 Cleanup(); | 136 Cleanup(); |
| 137 } | 137 } |
| 138 } | 138 } |
| OLD | NEW |