| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/sync/test/integration/autofill_helper.h" | 10 #include "chrome/browser/sync/test/integration/autofill_helper.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 return IntToValue(value_number_++); | 158 return IntToValue(value_number_++); |
| 159 } | 159 } |
| 160 | 160 |
| 161 const std::string AutofillSyncPerfTest::IntToValue(int n) { | 161 const std::string AutofillSyncPerfTest::IntToValue(int n) { |
| 162 return base::StringPrintf("Value%d", n); | 162 return base::StringPrintf("Value%d", n); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ForceSync(int profile) { | 165 void ForceSync(int profile) { |
| 166 static int id = 0; | 166 static int id = 0; |
| 167 ++id; | 167 ++id; |
| 168 EXPECT_TRUE( | 168 EXPECT_TRUE(bookmarks_helper::AddURL( |
| 169 bookmarks_helper::AddURL(profile, 0, | 169 profile, 0, bookmarks_helper::IndexedURLTitle(id), |
| 170 bookmarks_helper::IndexedURLTitle(id), | 170 GURL(bookmarks_helper::IndexedURL(id))) != nullptr); |
| 171 GURL(bookmarks_helper::IndexedURL(id))) != NULL); | |
| 172 } | 171 } |
| 173 | 172 |
| 174 IN_PROC_BROWSER_TEST_F(AutofillSyncPerfTest, AutofillProfiles_P0) { | 173 IN_PROC_BROWSER_TEST_F(AutofillSyncPerfTest, AutofillProfiles_P0) { |
| 175 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 174 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 176 | 175 |
| 177 // TCM ID - 7557873. | 176 // TCM ID - 7557873. |
| 178 AddProfiles(0, kNumProfiles); | 177 AddProfiles(0, kNumProfiles); |
| 179 base::TimeDelta dt = TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 178 base::TimeDelta dt = TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 180 ASSERT_EQ(kNumProfiles, GetProfileCount(1)); | 179 ASSERT_EQ(kNumProfiles, GetProfileCount(1)); |
| 181 PrintResult("autofill", "add_autofill_profiles", dt); | 180 PrintResult("autofill", "add_autofill_profiles", dt); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 203 ASSERT_EQ(kNumKeys, GetKeyCount(1)); | 202 ASSERT_EQ(kNumKeys, GetKeyCount(1)); |
| 204 PrintResult("autofill", "add_autofill_keys", dt); | 203 PrintResult("autofill", "add_autofill_keys", dt); |
| 205 | 204 |
| 206 RemoveKeys(0); | 205 RemoveKeys(0); |
| 207 // TODO(lipalani): fix this. The following line is added to force sync. | 206 // TODO(lipalani): fix this. The following line is added to force sync. |
| 208 ForceSync(0); | 207 ForceSync(0); |
| 209 dt = TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 208 dt = TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 210 ASSERT_EQ(0, GetKeyCount(1)); | 209 ASSERT_EQ(0, GetKeyCount(1)); |
| 211 PrintResult("autofill", "delete_autofill_keys", dt); | 210 PrintResult("autofill", "delete_autofill_keys", dt); |
| 212 } | 211 } |
| OLD | NEW |