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 "chrome/test/live_sync/live_sessions_sync_test.h" | 5 #include "chrome/test/live_sync/live_sessions_sync_test.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/sessions/session_service.h" | 8 #include "chrome/browser/sessions/session_service.h" |
| 9 #include "chrome/browser/sessions/session_service_factory.h" |
9 #include "chrome/browser/sync/profile_sync_service.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
10 #include "chrome/browser/sync/glue/session_model_associator.h" | 11 #include "chrome/browser/sync/glue/session_model_associator.h" |
11 #include "chrome/test/ui_test_utils.h" | 12 #include "chrome/test/ui_test_utils.h" |
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
13 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
14 #include "content/browser/tab_contents/tab_contents.h" | 15 #include "content/browser/tab_contents/tab_contents.h" |
15 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
16 | 17 |
17 TestSessionService::TestSessionService() | 18 TestSessionService::TestSessionService() |
18 : SessionServiceTestHelper(), | 19 : SessionServiceTestHelper(), |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ReleaseService(); // We don't own this, so don't destroy it. | 98 ReleaseService(); // We don't own this, so don't destroy it. |
98 } | 99 } |
99 | 100 |
100 LiveSessionsSyncTest::LiveSessionsSyncTest(TestType test_type) | 101 LiveSessionsSyncTest::LiveSessionsSyncTest(TestType test_type) |
101 : LiveSyncTest(test_type), | 102 : LiveSyncTest(test_type), |
102 done_closing_(false, false) {} | 103 done_closing_(false, false) {} |
103 | 104 |
104 LiveSessionsSyncTest::~LiveSessionsSyncTest() {} | 105 LiveSessionsSyncTest::~LiveSessionsSyncTest() {} |
105 | 106 |
106 SessionService* LiveSessionsSyncTest::GetSessionService(int index) { | 107 SessionService* LiveSessionsSyncTest::GetSessionService(int index) { |
107 return GetProfile(index)->GetSessionService(); | 108 return SessionServiceFactory::GetForProfile(GetProfile(index)); |
108 } | 109 } |
109 | 110 |
110 TestSessionService* LiveSessionsSyncTest::GetHelper(int index) { | 111 TestSessionService* LiveSessionsSyncTest::GetHelper(int index) { |
111 return test_session_services_[index]->get(); | 112 return test_session_services_[index]->get(); |
112 } | 113 } |
113 | 114 |
114 Browser* LiveSessionsSyncTest::GetBrowser(int index) { | 115 Browser* LiveSessionsSyncTest::GetBrowser(int index) { |
115 return browsers_[index]; | 116 return browsers_[index]; |
116 } | 117 } |
117 | 118 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 // sync profile. | 305 // sync profile. |
305 BrowserList::CloseAllBrowsers(); | 306 BrowserList::CloseAllBrowsers(); |
306 ui_test_utils::RunAllPendingInMessageLoop(); | 307 ui_test_utils::RunAllPendingInMessageLoop(); |
307 | 308 |
308 // All browsers should be closed at this point, else when the framework | 309 // All browsers should be closed at this point, else when the framework |
309 // calls QuitBrowsers() we could see memory corruption. | 310 // calls QuitBrowsers() we could see memory corruption. |
310 ASSERT_EQ(0U, BrowserList::size()); | 311 ASSERT_EQ(0U, BrowserList::size()); |
311 | 312 |
312 LiveSyncTest::CleanUpOnMainThread(); | 313 LiveSyncTest::CleanUpOnMainThread(); |
313 } | 314 } |
OLD | NEW |