| 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 "base/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "chrome/browser/sync/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 7 #include "chrome/browser/sync/test/live_sync/extensions_helper.h" | 7 #include "chrome/browser/sync/test/integration/extensions_helper.h" |
| 8 #include "chrome/browser/sync/test/live_sync/live_sync_test.h" | 8 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" |
| 9 #include "chrome/browser/sync/test/live_sync/performance/sync_timing_helper.h" | 9 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 10 | 10 |
| 11 using extensions_helper::AllProfilesHaveSameExtensions; | 11 using extensions_helper::AllProfilesHaveSameExtensions; |
| 12 using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier; | 12 using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier; |
| 13 using extensions_helper::DisableExtension; | 13 using extensions_helper::DisableExtension; |
| 14 using extensions_helper::EnableExtension; | 14 using extensions_helper::EnableExtension; |
| 15 using extensions_helper::GetInstalledExtensions; | 15 using extensions_helper::GetInstalledExtensions; |
| 16 using extensions_helper::InstallExtension; | 16 using extensions_helper::InstallExtension; |
| 17 using extensions_helper::InstallExtensionsPendingForSync; | 17 using extensions_helper::InstallExtensionsPendingForSync; |
| 18 using extensions_helper::IsExtensionEnabled; | 18 using extensions_helper::IsExtensionEnabled; |
| 19 using extensions_helper::UninstallExtension; | 19 using extensions_helper::UninstallExtension; |
| 20 | 20 |
| 21 // TODO(braffert): Replicate these tests for apps. | 21 // TODO(braffert): Replicate these tests for apps. |
| 22 | 22 |
| 23 static const int kNumExtensions = 150; | 23 static const int kNumExtensions = 150; |
| 24 | 24 |
| 25 class ExtensionsSyncPerfTest : public LiveSyncTest { | 25 class ExtensionsSyncPerfTest : public SyncTest { |
| 26 public: | 26 public: |
| 27 ExtensionsSyncPerfTest() | 27 ExtensionsSyncPerfTest() |
| 28 : LiveSyncTest(TWO_CLIENT), | 28 : SyncTest(TWO_CLIENT), |
| 29 extension_number_(0) {} | 29 extension_number_(0) {} |
| 30 | 30 |
| 31 // Adds |num_extensions| new unique extensions to |profile|. | 31 // Adds |num_extensions| new unique extensions to |profile|. |
| 32 void AddExtensions(int profile, int num_extensions); | 32 void AddExtensions(int profile, int num_extensions); |
| 33 | 33 |
| 34 // Updates the enabled/disabled state for all extensions in |profile|. | 34 // Updates the enabled/disabled state for all extensions in |profile|. |
| 35 void UpdateExtensions(int profile); | 35 void UpdateExtensions(int profile); |
| 36 | 36 |
| 37 // Uninstalls all currently installed extensions from |profile|. | 37 // Uninstalls all currently installed extensions from |profile|. |
| 38 void RemoveExtensions(int profile); | 38 void RemoveExtensions(int profile); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 93 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 94 ASSERT_EQ(expected_extension_count, GetExtensionCount(1)); | 94 ASSERT_EQ(expected_extension_count, GetExtensionCount(1)); |
| 95 SyncTimingHelper::PrintResult("extensions", "update_extensions", dt); | 95 SyncTimingHelper::PrintResult("extensions", "update_extensions", dt); |
| 96 | 96 |
| 97 // TCM ID - 7567721. | 97 // TCM ID - 7567721. |
| 98 RemoveExtensions(0); | 98 RemoveExtensions(0); |
| 99 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 99 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
| 100 ASSERT_EQ(num_default_extensions, GetExtensionCount(1)); | 100 ASSERT_EQ(num_default_extensions, GetExtensionCount(1)); |
| 101 SyncTimingHelper::PrintResult("extensions", "delete_extensions", dt); | 101 SyncTimingHelper::PrintResult("extensions", "delete_extensions", dt); |
| 102 } | 102 } |
| OLD | NEW |