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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 if (!GetSessionData(profile, &sessions)) { | 91 if (!GetSessionData(profile, &sessions)) { |
92 // Foreign session data may be empty. In this case we only count tabs in | 92 // Foreign session data may be empty. In this case we only count tabs in |
93 // the local session. | 93 // the local session. |
94 DVLOG(1) << "GetSessionData returned false"; | 94 DVLOG(1) << "GetSessionData returned false"; |
95 } | 95 } |
96 | 96 |
97 int tab_count = 0; | 97 int tab_count = 0; |
98 sessions.push_back(local_session); | 98 sessions.push_back(local_session); |
99 for (auto* session : sessions) | 99 for (auto* session : sessions) |
100 for (const auto& win_pair : session->windows) | 100 for (const auto& win_pair : session->windows) |
101 tab_count += win_pair.second->tabs.size(); | 101 tab_count += win_pair.second->wrapped_window.tabs.size(); |
102 | 102 |
103 return tab_count; | 103 return tab_count; |
104 } | 104 } |
105 | 105 |
106 GURL SessionsSyncPerfTest::NextURL() { | 106 GURL SessionsSyncPerfTest::NextURL() { |
107 return IntToURL(url_number_++); | 107 return IntToURL(url_number_++); |
108 } | 108 } |
109 | 109 |
110 GURL SessionsSyncPerfTest::IntToURL(int n) { | 110 GURL SessionsSyncPerfTest::IntToURL(int n) { |
111 return GURL(base::StringPrintf("http://localhost/%d", n)); | 111 return GURL(base::StringPrintf("http://localhost/%d", n)); |
(...skipping 15 matching lines...) Expand all Loading... |
127 ASSERT_EQ(kNumTabs, GetTabCount(1)); | 127 ASSERT_EQ(kNumTabs, GetTabCount(1)); |
128 PrintResult("tabs", "update_tabs", dt); | 128 PrintResult("tabs", "update_tabs", dt); |
129 | 129 |
130 RemoveTabs(0); | 130 RemoveTabs(0); |
131 dt = TimeMutualSyncCycle(GetClient(0), GetClient(1)); | 131 dt = TimeMutualSyncCycle(GetClient(0), GetClient(1)); |
132 // New tab page remains open on profile 0 after closing all tabs. | 132 // New tab page remains open on profile 0 after closing all tabs. |
133 ASSERT_EQ(1, GetTabCount(0)); | 133 ASSERT_EQ(1, GetTabCount(0)); |
134 ASSERT_EQ(0, GetTabCount(1)); | 134 ASSERT_EQ(0, GetTabCount(1)); |
135 PrintResult("tabs", "delete_tabs", dt); | 135 PrintResult("tabs", "delete_tabs", dt); |
136 } | 136 } |
OLD | NEW |