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

Side by Side Diff: chrome/browser/sync/test/integration/performance/extensions_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) 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 "chrome/browser/sync/test/integration/extensions_helper.h" 7 #include "chrome/browser/sync/test/integration/extensions_helper.h"
8 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" 8 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h"
9 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" 9 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
10 #include "chrome/browser/sync/test/integration/sync_test.h" 10 #include "chrome/browser/sync/test/integration/sync_test.h"
11 11
12 using extensions_helper::AllProfilesHaveSameExtensions; 12 using extensions_helper::AllProfilesHaveSameExtensions;
13 using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier; 13 using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier;
14 using extensions_helper::DisableExtension; 14 using extensions_helper::DisableExtension;
15 using extensions_helper::EnableExtension; 15 using extensions_helper::EnableExtension;
16 using extensions_helper::GetInstalledExtensions; 16 using extensions_helper::GetInstalledExtensions;
17 using extensions_helper::InstallExtension; 17 using extensions_helper::InstallExtension;
18 using extensions_helper::InstallExtensionsPendingForSync; 18 using extensions_helper::InstallExtensionsPendingForSync;
19 using extensions_helper::IsExtensionEnabled; 19 using extensions_helper::IsExtensionEnabled;
20 using extensions_helper::UninstallExtension; 20 using extensions_helper::UninstallExtension;
21 using sync_timing_helper::PrintResult;
22 using sync_timing_helper::TimeMutualSyncCycle;
21 23
22 // TODO(braffert): Replicate these tests for apps. 24 // TODO(braffert): Replicate these tests for apps.
23 25
24 static const int kNumExtensions = 150; 26 static const int kNumExtensions = 150;
25 27
26 class ExtensionsSyncPerfTest : public SyncTest { 28 class ExtensionsSyncPerfTest : public SyncTest {
27 public: 29 public:
28 ExtensionsSyncPerfTest() 30 ExtensionsSyncPerfTest()
29 : SyncTest(TWO_CLIENT), 31 : SyncTest(TWO_CLIENT),
30 extension_number_(0) {} 32 extension_number_(0) {}
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 78 }
77 } 79 }
78 80
79 IN_PROC_BROWSER_TEST_F(ExtensionsSyncPerfTest, P0) { 81 IN_PROC_BROWSER_TEST_F(ExtensionsSyncPerfTest, P0) {
80 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 82 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
81 int num_default_extensions = GetExtensionCount(0); 83 int num_default_extensions = GetExtensionCount(0);
82 int expected_extension_count = num_default_extensions + kNumExtensions; 84 int expected_extension_count = num_default_extensions + kNumExtensions;
83 85
84 // TCM ID - 7563874. 86 // TCM ID - 7563874.
85 AddExtensions(0, kNumExtensions); 87 AddExtensions(0, kNumExtensions);
86 base::TimeDelta dt = 88 base::TimeDelta dt = TimeMutualSyncCycle(GetClient(0), GetClient(1));
87 SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1));
88 InstallExtensionsPendingForSync(GetProfile(1)); 89 InstallExtensionsPendingForSync(GetProfile(1));
89 ASSERT_EQ(expected_extension_count, GetExtensionCount(1)); 90 ASSERT_EQ(expected_extension_count, GetExtensionCount(1));
90 SyncTimingHelper::PrintResult("extensions", "add_extensions", dt); 91 PrintResult("extensions", "add_extensions", dt);
91 92
92 // TCM ID - 7655397. 93 // TCM ID - 7655397.
93 UpdateExtensions(0); 94 UpdateExtensions(0);
94 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); 95 dt = TimeMutualSyncCycle(GetClient(0), GetClient(1));
95 ASSERT_EQ(expected_extension_count, GetExtensionCount(1)); 96 ASSERT_EQ(expected_extension_count, GetExtensionCount(1));
96 SyncTimingHelper::PrintResult("extensions", "update_extensions", dt); 97 PrintResult("extensions", "update_extensions", dt);
97 98
98 // TCM ID - 7567721. 99 // TCM ID - 7567721.
99 RemoveExtensions(0); 100 RemoveExtensions(0);
100 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); 101 dt = TimeMutualSyncCycle(GetClient(0), GetClient(1));
101 ASSERT_EQ(num_default_extensions, GetExtensionCount(1)); 102 ASSERT_EQ(num_default_extensions, GetExtensionCount(1));
102 SyncTimingHelper::PrintResult("extensions", "delete_extensions", dt); 103 PrintResult("extensions", "delete_extensions", dt);
103 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698