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 "chrome/browser/sync/profile_sync_service_harness.h" | 5 #include "chrome/browser/sync/profile_sync_service_harness.h" |
6 #include "chrome/test/live_sync/bookmarks_helper.h" | 6 #include "chrome/test/live_sync/bookmarks_helper.h" |
7 #include "chrome/test/live_sync/live_sync_test.h" | 7 #include "chrome/test/live_sync/live_sync_test.h" |
8 #include "chrome/test/live_sync/performance/sync_timing_helper.h" | 8 #include "chrome/test/live_sync/performance/sync_timing_helper.h" |
9 | 9 |
10 using bookmarks_helper::AddURL; | 10 using bookmarks_helper::AddURL; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 | 104 |
105 IN_PROC_BROWSER_TEST_F(BookmarksSyncPerfTest, P0) { | 105 IN_PROC_BROWSER_TEST_F(BookmarksSyncPerfTest, P0) { |
106 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 106 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
107 | 107 |
108 // TCM ID - 7556828. | 108 // TCM ID - 7556828. |
109 AddURLs(0, kNumBookmarks); | 109 AddURLs(0, kNumBookmarks); |
110 base::TimeDelta dt = | 110 base::TimeDelta dt = |
111 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 111 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
112 ASSERT_EQ(kNumBookmarks, GetURLCount(1)); | 112 ASSERT_EQ(kNumBookmarks, GetURLCount(1)); |
113 SyncTimingHelper::PrintResult("bookmarks", "add", dt); | 113 SyncTimingHelper::PrintResult("bookmarks", "add_bookmarks", dt); |
114 | 114 |
115 // TCM ID - 7564762. | 115 // TCM ID - 7564762. |
116 UpdateURLs(0); | 116 UpdateURLs(0); |
117 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 117 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
118 ASSERT_EQ(kNumBookmarks, GetURLCount(1)); | 118 ASSERT_EQ(kNumBookmarks, GetURLCount(1)); |
119 SyncTimingHelper::PrintResult("bookmarks", "update", dt); | 119 SyncTimingHelper::PrintResult("bookmarks", "update_bookmarks", dt); |
120 | 120 |
121 // TCM ID - 7566626. | 121 // TCM ID - 7566626. |
122 RemoveURLs(0); | 122 RemoveURLs(0); |
123 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 123 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
124 ASSERT_EQ(0, GetURLCount(1)); | 124 ASSERT_EQ(0, GetURLCount(1)); |
125 SyncTimingHelper::PrintResult("bookmarks", "delete", dt); | 125 SyncTimingHelper::PrintResult("bookmarks", "delete_bookmarks", dt); |
126 } | 126 } |
127 | 127 |
128 IN_PROC_BROWSER_TEST_F(BookmarksSyncPerfTest, DISABLED_Benchmark) { | 128 IN_PROC_BROWSER_TEST_F(BookmarksSyncPerfTest, DISABLED_Benchmark) { |
129 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 129 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
130 DisableVerifier(); | 130 DisableVerifier(); |
131 | 131 |
132 for (int i = 0; i < kNumBenchmarkPoints; ++i) { | 132 for (int i = 0; i < kNumBenchmarkPoints; ++i) { |
133 int num_bookmarks = kBenchmarkPoints[i]; | 133 int num_bookmarks = kBenchmarkPoints[i]; |
134 AddURLs(0, num_bookmarks); | 134 AddURLs(0, num_bookmarks); |
135 base::TimeDelta dt_add = | 135 base::TimeDelta dt_add = |
(...skipping 15 matching lines...) Expand all Loading... |
151 base::TimeDelta dt_delete = | 151 base::TimeDelta dt_delete = |
152 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 152 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
153 ASSERT_EQ(0, GetBookmarkBarNode(0)->child_count()); | 153 ASSERT_EQ(0, GetBookmarkBarNode(0)->child_count()); |
154 ASSERT_TRUE(AllModelsMatch()); | 154 ASSERT_TRUE(AllModelsMatch()); |
155 VLOG(0) << std::endl << "Delete: " << num_bookmarks << " " | 155 VLOG(0) << std::endl << "Delete: " << num_bookmarks << " " |
156 << dt_delete.InSecondsF(); | 156 << dt_delete.InSecondsF(); |
157 | 157 |
158 Cleanup(); | 158 Cleanup(); |
159 } | 159 } |
160 } | 160 } |
OLD | NEW |