OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/sync/test/integration/sessions_helper.h" | 5 #include "chrome/browser/sync/test/integration/sessions_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 std::swap(*windows, windows_); | 51 std::swap(*windows, windows_); |
52 } | 52 } |
53 | 53 |
54 bool GetLocalSession(int index, const browser_sync::SyncedSession** session) { | 54 bool GetLocalSession(int index, const browser_sync::SyncedSession** session) { |
55 return ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 55 return ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
56 test()->GetProfile(index))->GetSessionModelAssociator()->GetLocalSession( | 56 test()->GetProfile(index))->GetSessionModelAssociator()->GetLocalSession( |
57 session); | 57 session); |
58 } | 58 } |
59 | 59 |
60 bool ModelAssociatorHasTabWithUrl(int index, const GURL& url) { | 60 bool ModelAssociatorHasTabWithUrl(int index, const GURL& url) { |
61 ui_test_utils::RunAllPendingInMessageLoop(); | 61 content::RunAllPendingInMessageLoop(); |
62 const browser_sync::SyncedSession* local_session; | 62 const browser_sync::SyncedSession* local_session; |
63 if (!GetLocalSession(index, &local_session)) { | 63 if (!GetLocalSession(index, &local_session)) { |
64 return false; | 64 return false; |
65 } | 65 } |
66 | 66 |
67 if (local_session->windows.size() == 0) { | 67 if (local_session->windows.size() == 0) { |
68 DVLOG(1) << "Empty windows vector"; | 68 DVLOG(1) << "Empty windows vector"; |
69 return false; | 69 return false; |
70 } | 70 } |
71 | 71 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 return true; | 307 return true; |
308 } | 308 } |
309 | 309 |
310 void DeleteForeignSession(int index, std::string session_tag) { | 310 void DeleteForeignSession(int index, std::string session_tag) { |
311 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 311 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
312 test()->GetProfile(index))-> | 312 test()->GetProfile(index))-> |
313 GetSessionModelAssociator()->DeleteForeignSession(session_tag); | 313 GetSessionModelAssociator()->DeleteForeignSession(session_tag); |
314 } | 314 } |
315 | 315 |
316 } // namespace sessions_helper | 316 } // namespace sessions_helper |
OLD | NEW |