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/ui/browser.h" | 6 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/sync/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/profile_sync_service_harness.h" |
8 #include "chrome/browser/sync/test/live_sync/performance/sync_timing_helper.h" | 8 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" |
9 #include "chrome/browser/sync/test/live_sync/live_sync_test.h" | 9 #include "chrome/browser/sync/test/integration/sessions_helper.h" |
10 #include "chrome/browser/sync/test/live_sync/sessions_helper.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
11 | 11 |
12 using sessions_helper::GetLocalSession; | 12 using sessions_helper::GetLocalSession; |
13 using sessions_helper::GetSessionData; | 13 using sessions_helper::GetSessionData; |
14 using sessions_helper::OpenMultipleTabs; | 14 using sessions_helper::OpenMultipleTabs; |
15 using sessions_helper::WaitForTabsToLoad; | 15 using sessions_helper::WaitForTabsToLoad; |
16 | 16 |
17 static const int kNumTabs = 150; | 17 static const int kNumTabs = 150; |
18 | 18 |
19 class SessionsSyncPerfTest: public LiveSyncTest { | 19 class SessionsSyncPerfTest: public SyncTest { |
20 public: | 20 public: |
21 SessionsSyncPerfTest() : LiveSyncTest(TWO_CLIENT), url_number_(0) {} | 21 SessionsSyncPerfTest() : SyncTest(TWO_CLIENT), url_number_(0) {} |
22 | 22 |
23 // Opens |num_tabs| new tabs on |profile|. | 23 // Opens |num_tabs| new tabs on |profile|. |
24 void AddTabs(int profile, int num_tabs); | 24 void AddTabs(int profile, int num_tabs); |
25 | 25 |
26 // Update all tabs in |profile| by visiting a new URL. | 26 // Update all tabs in |profile| by visiting a new URL. |
27 void UpdateTabs(int profile); | 27 void UpdateTabs(int profile); |
28 | 28 |
29 // Close all tabs in |profile|. | 29 // Close all tabs in |profile|. |
30 void RemoveTabs(int profile); | 30 void RemoveTabs(int profile); |
31 | 31 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ASSERT_EQ(kNumTabs, GetTabCount(1)); | 122 ASSERT_EQ(kNumTabs, GetTabCount(1)); |
123 SyncTimingHelper::PrintResult("tabs", "update_tabs", dt); | 123 SyncTimingHelper::PrintResult("tabs", "update_tabs", dt); |
124 | 124 |
125 RemoveTabs(0); | 125 RemoveTabs(0); |
126 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 126 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
127 // New tab page remains open on profile 0 after closing all tabs. | 127 // New tab page remains open on profile 0 after closing all tabs. |
128 ASSERT_EQ(1, GetTabCount(0)); | 128 ASSERT_EQ(1, GetTabCount(0)); |
129 ASSERT_EQ(0, GetTabCount(1)); | 129 ASSERT_EQ(0, GetTabCount(1)); |
130 SyncTimingHelper::PrintResult("tabs", "delete_tabs", dt); | 130 SyncTimingHelper::PrintResult("tabs", "delete_tabs", dt); |
131 } | 131 } |
OLD | NEW |