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/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/sessions_helper.h" | 9 #include "chrome/browser/sync/test/integration/sessions_helper.h" |
10 #include "chrome/browser/sync/test/integration/sync_test.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 void SessionsSyncPerfTest::UpdateTabs(int profile) { | 57 void SessionsSyncPerfTest::UpdateTabs(int profile) { |
58 Browser* browser = GetBrowser(profile); | 58 Browser* browser = GetBrowser(profile); |
59 GURL url; | 59 GURL url; |
60 std::vector<GURL> urls; | 60 std::vector<GURL> urls; |
61 for (int i = 0; i < browser->tab_count(); ++i) { | 61 for (int i = 0; i < browser->tab_count(); ++i) { |
62 browser->SelectNumberedTab(i); | 62 browser->SelectNumberedTab(i); |
63 url = NextURL(); | 63 url = NextURL(); |
64 browser->OpenURL( | 64 browser->OpenURL( |
65 OpenURLParams(url, GURL("http://localhost"), CURRENT_TAB, | 65 OpenURLParams(url, |
| 66 content::Referrer(GURL("http://localhost"), |
| 67 WebKit::WebReferrerPolicyDefault), |
| 68 CURRENT_TAB, |
66 content::PageTransitionFromInt(0), false)); | 69 content::PageTransitionFromInt(0), false)); |
67 urls.push_back(url); | 70 urls.push_back(url); |
68 } | 71 } |
69 WaitForTabsToLoad(profile, urls); | 72 WaitForTabsToLoad(profile, urls); |
70 } | 73 } |
71 | 74 |
72 void SessionsSyncPerfTest::RemoveTabs(int profile) { | 75 void SessionsSyncPerfTest::RemoveTabs(int profile) { |
73 GetBrowser(profile)->CloseAllTabs(); | 76 GetBrowser(profile)->CloseAllTabs(); |
74 } | 77 } |
75 | 78 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 ASSERT_EQ(kNumTabs, GetTabCount(1)); | 129 ASSERT_EQ(kNumTabs, GetTabCount(1)); |
127 SyncTimingHelper::PrintResult("tabs", "update_tabs", dt); | 130 SyncTimingHelper::PrintResult("tabs", "update_tabs", dt); |
128 | 131 |
129 RemoveTabs(0); | 132 RemoveTabs(0); |
130 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 133 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
131 // New tab page remains open on profile 0 after closing all tabs. | 134 // New tab page remains open on profile 0 after closing all tabs. |
132 ASSERT_EQ(1, GetTabCount(0)); | 135 ASSERT_EQ(1, GetTabCount(0)); |
133 ASSERT_EQ(0, GetTabCount(1)); | 136 ASSERT_EQ(0, GetTabCount(1)); |
134 SyncTimingHelper::PrintResult("tabs", "delete_tabs", dt); | 137 SyncTimingHelper::PrintResult("tabs", "delete_tabs", dt); |
135 } | 138 } |
OLD | NEW |