Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: chrome/browser/sync/test/integration/performance/bookmarks_sync_perf_test.cc

Issue 2379433002: [Sync] Refactoring of sync integration test checkers to remove boilerplate await methods. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/macros.h" 5 #include "base/macros.h"
6 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" 6 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
7 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" 7 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h"
8 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" 8 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
9 #include "chrome/browser/sync/test/integration/sync_test.h" 9 #include "chrome/browser/sync/test/integration/sync_test.h"
10 #include "components/bookmarks/browser/bookmark_node.h" 10 #include "components/bookmarks/browser/bookmark_node.h"
11 11
12 using bookmarks_helper::AddURL; 12 using bookmarks_helper::AddURL;
13 using bookmarks_helper::AllModelsMatch; 13 using bookmarks_helper::AllModelsMatch;
14 using bookmarks_helper::GetBookmarkBarNode; 14 using bookmarks_helper::GetBookmarkBarNode;
15 using bookmarks_helper::IndexedURL; 15 using bookmarks_helper::IndexedURL;
16 using bookmarks_helper::IndexedURLTitle; 16 using bookmarks_helper::IndexedURLTitle;
17 using bookmarks_helper::Remove; 17 using bookmarks_helper::Remove;
18 using bookmarks_helper::SetURL; 18 using bookmarks_helper::SetURL;
19 using sync_timing_helper::PrintResult;
20 using sync_timing_helper::TimeMutualSyncCycle;
19 21
20 static const int kNumBookmarks = 150; 22 static const int kNumBookmarks = 150;
21 23
22 class BookmarksSyncPerfTest : public SyncTest { 24 class BookmarksSyncPerfTest : public SyncTest {
23 public: 25 public:
24 BookmarksSyncPerfTest() 26 BookmarksSyncPerfTest()
25 : SyncTest(TWO_CLIENT), 27 : SyncTest(TWO_CLIENT),
26 url_number_(0), 28 url_number_(0),
27 url_title_number_(0) {} 29 url_title_number_(0) {}
28 30
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 85
84 std::string BookmarksSyncPerfTest::NextIndexedURLTitle() { 86 std::string BookmarksSyncPerfTest::NextIndexedURLTitle() {
85 return IndexedURLTitle(url_title_number_++); 87 return IndexedURLTitle(url_title_number_++);
86 } 88 }
87 89
88 IN_PROC_BROWSER_TEST_F(BookmarksSyncPerfTest, P0) { 90 IN_PROC_BROWSER_TEST_F(BookmarksSyncPerfTest, P0) {
89 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 91 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
90 92
91 // TCM ID - 7556828. 93 // TCM ID - 7556828.
92 AddURLs(0, kNumBookmarks); 94 AddURLs(0, kNumBookmarks);
93 base::TimeDelta dt = 95 base::TimeDelta dt = TimeMutualSyncCycle(GetClient(0), GetClient(1));
94 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1));
95 ASSERT_EQ(kNumBookmarks, GetURLCount(1)); 96 ASSERT_EQ(kNumBookmarks, GetURLCount(1));
96 SyncTimingHelper::PrintResult("bookmarks", "add_bookmarks", dt); 97 PrintResult("bookmarks", "add_bookmarks", dt);
97 98
98 // TCM ID - 7564762. 99 // TCM ID - 7564762.
99 UpdateURLs(0); 100 UpdateURLs(0);
100 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); 101 dt = TimeMutualSyncCycle(GetClient(0), GetClient(1));
101 ASSERT_EQ(kNumBookmarks, GetURLCount(1)); 102 ASSERT_EQ(kNumBookmarks, GetURLCount(1));
102 SyncTimingHelper::PrintResult("bookmarks", "update_bookmarks", dt); 103 PrintResult("bookmarks", "update_bookmarks", dt);
103 104
104 // TCM ID - 7566626. 105 // TCM ID - 7566626.
105 RemoveURLs(0); 106 RemoveURLs(0);
106 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); 107 dt = TimeMutualSyncCycle(GetClient(0), GetClient(1));
107 ASSERT_EQ(0, GetURLCount(1)); 108 ASSERT_EQ(0, GetURLCount(1));
108 SyncTimingHelper::PrintResult("bookmarks", "delete_bookmarks", dt); 109 PrintResult("bookmarks", "delete_bookmarks", dt);
109 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698