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/browser/sync/test/live_sync/bookmarks_helper.h" | 6 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
7 #include "chrome/browser/sync/test/live_sync/live_sync_test.h" | 7 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" |
8 #include "chrome/browser/sync/test/live_sync/performance/sync_timing_helper.h" | 8 #include "chrome/browser/sync/test/integration/sync_test.h" |
9 | 9 |
10 using bookmarks_helper::AddURL; | 10 using bookmarks_helper::AddURL; |
11 using bookmarks_helper::AllModelsMatch; | 11 using bookmarks_helper::AllModelsMatch; |
12 using bookmarks_helper::GetBookmarkBarNode; | 12 using bookmarks_helper::GetBookmarkBarNode; |
13 using bookmarks_helper::IndexedURL; | 13 using bookmarks_helper::IndexedURL; |
14 using bookmarks_helper::IndexedURLTitle; | 14 using bookmarks_helper::IndexedURLTitle; |
15 using bookmarks_helper::Remove; | 15 using bookmarks_helper::Remove; |
16 using bookmarks_helper::SetURL; | 16 using bookmarks_helper::SetURL; |
17 | 17 |
18 static const int kNumBookmarks = 150; | 18 static const int kNumBookmarks = 150; |
19 | 19 |
20 class BookmarksSyncPerfTest : public LiveSyncTest { | 20 class BookmarksSyncPerfTest : public SyncTest { |
21 public: | 21 public: |
22 BookmarksSyncPerfTest() | 22 BookmarksSyncPerfTest() |
23 : LiveSyncTest(TWO_CLIENT), | 23 : SyncTest(TWO_CLIENT), |
24 url_number_(0), | 24 url_number_(0), |
25 url_title_number_(0) {} | 25 url_title_number_(0) {} |
26 | 26 |
27 // Adds |num_urls| new unique bookmarks to the bookmark bar for |profile|. | 27 // Adds |num_urls| new unique bookmarks to the bookmark bar for |profile|. |
28 void AddURLs(int profile, int num_urls); | 28 void AddURLs(int profile, int num_urls); |
29 | 29 |
30 // Updates the URL for all bookmarks in the bookmark bar for |profile|. | 30 // Updates the URL for all bookmarks in the bookmark bar for |profile|. |
31 void UpdateURLs(int profile); | 31 void UpdateURLs(int profile); |
32 | 32 |
33 // Removes all bookmarks in the bookmark bar for |profile|. | 33 // Removes all bookmarks in the bookmark bar for |profile|. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 98 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
99 ASSERT_EQ(kNumBookmarks, GetURLCount(1)); | 99 ASSERT_EQ(kNumBookmarks, GetURLCount(1)); |
100 SyncTimingHelper::PrintResult("bookmarks", "update_bookmarks", dt); | 100 SyncTimingHelper::PrintResult("bookmarks", "update_bookmarks", dt); |
101 | 101 |
102 // TCM ID - 7566626. | 102 // TCM ID - 7566626. |
103 RemoveURLs(0); | 103 RemoveURLs(0); |
104 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 104 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
105 ASSERT_EQ(0, GetURLCount(1)); | 105 ASSERT_EQ(0, GetURLCount(1)); |
106 SyncTimingHelper::PrintResult("bookmarks", "delete_bookmarks", dt); | 106 SyncTimingHelper::PrintResult("bookmarks", "delete_bookmarks", dt); |
107 } | 107 } |
OLD | NEW |