Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: chrome/browser/sync/test/integration/sessions_helper.cc

Issue 10825085: Move RunAllPendingInMessageLoop from ui_test_utils.h to test_utils.h, so that it can be reused by c… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/protector/protector_service_browsertest.cc ('k') | chrome/browser/sync/test/integration/sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698