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/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/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/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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 OpenMultipleTabs(profile, urls); | 58 OpenMultipleTabs(profile, urls); |
59 } | 59 } |
60 | 60 |
61 void SessionsSyncPerfTest::UpdateTabs(int profile) { | 61 void SessionsSyncPerfTest::UpdateTabs(int profile) { |
62 Browser* browser = GetBrowser(profile); | 62 Browser* browser = GetBrowser(profile); |
63 GURL url; | 63 GURL url; |
64 std::vector<GURL> urls; | 64 std::vector<GURL> urls; |
65 for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { | 65 for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { |
66 chrome::SelectNumberedTab(browser, i); | 66 chrome::SelectNumberedTab(browser, i); |
67 url = NextURL(); | 67 url = NextURL(); |
68 browser->OpenURL( | 68 browser->OpenURL(OpenURLParams( |
69 OpenURLParams(url, | 69 url, content::Referrer(GURL("http://localhost"), |
70 content::Referrer(GURL("http://localhost"), | 70 blink::WebReferrerPolicyDefault), |
71 blink::WebReferrerPolicyDefault), | 71 WindowOpenDisposition::CURRENT_TAB, ui::PAGE_TRANSITION_LINK, false)); |
72 CURRENT_TAB, | |
73 ui::PAGE_TRANSITION_LINK, false)); | |
74 urls.push_back(url); | 72 urls.push_back(url); |
75 } | 73 } |
76 WaitForTabsToLoad(profile, urls); | 74 WaitForTabsToLoad(profile, urls); |
77 } | 75 } |
78 | 76 |
79 void SessionsSyncPerfTest::RemoveTabs(int profile) { | 77 void SessionsSyncPerfTest::RemoveTabs(int profile) { |
80 GetBrowser(profile)->tab_strip_model()->CloseAllTabs(); | 78 GetBrowser(profile)->tab_strip_model()->CloseAllTabs(); |
81 } | 79 } |
82 | 80 |
83 int SessionsSyncPerfTest::GetTabCount(int profile) { | 81 int SessionsSyncPerfTest::GetTabCount(int profile) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 ASSERT_EQ(kNumTabs, GetTabCount(1)); | 131 ASSERT_EQ(kNumTabs, GetTabCount(1)); |
134 SyncTimingHelper::PrintResult("tabs", "update_tabs", dt); | 132 SyncTimingHelper::PrintResult("tabs", "update_tabs", dt); |
135 | 133 |
136 RemoveTabs(0); | 134 RemoveTabs(0); |
137 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 135 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
138 // New tab page remains open on profile 0 after closing all tabs. | 136 // New tab page remains open on profile 0 after closing all tabs. |
139 ASSERT_EQ(1, GetTabCount(0)); | 137 ASSERT_EQ(1, GetTabCount(0)); |
140 ASSERT_EQ(0, GetTabCount(1)); | 138 ASSERT_EQ(0, GetTabCount(1)); |
141 SyncTimingHelper::PrintResult("tabs", "delete_tabs", dt); | 139 SyncTimingHelper::PrintResult("tabs", "delete_tabs", dt); |
142 } | 140 } |
OLD | NEW |