| 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/sync/test/integration/passwords_helper.h" | 9 #include "chrome/browser/sync/test/integration/passwords_helper.h" |
| 10 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" | 10 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" |
| 11 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 11 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| 12 #include "chrome/browser/sync/test/integration/sync_test.h" | 12 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 13 #include "components/password_manager/core/browser/password_store.h" | 13 #include "components/password_manager/core/browser/password_store.h" |
| 14 | 14 |
| 15 using passwords_helper::AddLogin; | 15 using passwords_helper::AddLogin; |
| 16 using passwords_helper::CreateTestPasswordForm; | 16 using passwords_helper::CreateTestPasswordForm; |
| 17 using passwords_helper::GetPasswordCount; | 17 using passwords_helper::GetPasswordCount; |
| 18 using passwords_helper::GetPasswordStore; | 18 using passwords_helper::GetPasswordStore; |
| 19 using passwords_helper::UpdateLogin; | 19 using passwords_helper::UpdateLogin; |
| 20 using sync_timing_helper::PrintResult; |
| 21 using sync_timing_helper::TimeUntilQuiescence; |
| 20 | 22 |
| 21 static const int kNumPasswords = 150; | 23 static const int kNumPasswords = 150; |
| 22 | 24 |
| 23 class PasswordsSyncPerfTest : public SyncTest { | 25 class PasswordsSyncPerfTest : public SyncTest { |
| 24 public: | 26 public: |
| 25 PasswordsSyncPerfTest() : SyncTest(TWO_CLIENT), password_number_(0) {} | 27 PasswordsSyncPerfTest() : SyncTest(TWO_CLIENT), password_number_(0) {} |
| 26 | 28 |
| 27 // Adds |num_logins| new unique passwords to |profile|. | 29 // Adds |num_logins| new unique passwords to |profile|. |
| 28 void AddLogins(int profile, int num_logins); | 30 void AddLogins(int profile, int num_logins); |
| 29 | 31 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #define MAYBE_P0 DISABLED_P0 | 78 #define MAYBE_P0 DISABLED_P0 |
| 77 #else | 79 #else |
| 78 #define MAYBE_P0 P0 | 80 #define MAYBE_P0 P0 |
| 79 #endif | 81 #endif |
| 80 | 82 |
| 81 IN_PROC_BROWSER_TEST_F(PasswordsSyncPerfTest, MAYBE_P0) { | 83 IN_PROC_BROWSER_TEST_F(PasswordsSyncPerfTest, MAYBE_P0) { |
| 82 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 84 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 83 | 85 |
| 84 // TCM ID - 7367749. | 86 // TCM ID - 7367749. |
| 85 AddLogins(0, kNumPasswords); | 87 AddLogins(0, kNumPasswords); |
| 86 base::TimeDelta dt = SyncTimingHelper::TimeUntilQuiescence(clients()); | 88 base::TimeDelta dt = TimeUntilQuiescence(clients()); |
| 87 ASSERT_EQ(kNumPasswords, GetPasswordCount(1)); | 89 ASSERT_EQ(kNumPasswords, GetPasswordCount(1)); |
| 88 SyncTimingHelper::PrintResult("passwords", "add_passwords", dt); | 90 PrintResult("passwords", "add_passwords", dt); |
| 89 | 91 |
| 90 // TCM ID - 7365093. | 92 // TCM ID - 7365093. |
| 91 UpdateLogins(0); | 93 UpdateLogins(0); |
| 92 dt = SyncTimingHelper::TimeUntilQuiescence(clients()); | 94 dt = TimeUntilQuiescence(clients()); |
| 93 ASSERT_EQ(kNumPasswords, GetPasswordCount(1)); | 95 ASSERT_EQ(kNumPasswords, GetPasswordCount(1)); |
| 94 SyncTimingHelper::PrintResult("passwords", "update_passwords", dt); | 96 PrintResult("passwords", "update_passwords", dt); |
| 95 | 97 |
| 96 // TCM ID - 7557852 | 98 // TCM ID - 7557852 |
| 97 RemoveLogins(0); | 99 RemoveLogins(0); |
| 98 dt = SyncTimingHelper::TimeUntilQuiescence(clients()); | 100 dt = TimeUntilQuiescence(clients()); |
| 99 ASSERT_EQ(0, GetPasswordCount(1)); | 101 ASSERT_EQ(0, GetPasswordCount(1)); |
| 100 SyncTimingHelper::PrintResult("passwords", "delete_passwords", dt); | 102 PrintResult("passwords", "delete_passwords", dt); |
| 101 } | 103 } |
| OLD | NEW |