OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ | 5 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ |
6 #define CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ | 6 #define CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/scoped_vector.h" | 13 #include "base/scoped_vector.h" |
14 #include "base/ref_counted.h" | 14 #include "base/ref_counted.h" |
15 #include "base/waitable_event.h" | 15 #include "base/waitable_event.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/browser_window.h" | 17 #include "chrome/browser/browser_window.h" |
18 #include "chrome/browser/profile.h" | 18 #include "chrome/browser/profile.h" |
19 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 19 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
20 #include "chrome/browser/sessions/base_session_service.h" | 20 #include "chrome/browser/sessions/base_session_service.h" |
21 #include "chrome/browser/sessions/session_service_test_helper.h" | 21 #include "chrome/browser/sessions/session_service_test_helper.h" |
22 #include "chrome/browser/tab_contents/tab_contents.h" | 22 #include "chrome/browser/tab_contents/tab_contents.h" |
| 23 #include "chrome/browser/tab_contents_wrapper.h" |
23 #include "chrome/test/live_sync/live_sync_test.h" | 24 #include "chrome/test/live_sync/live_sync_test.h" |
24 #include "chrome/test/ui_test_utils.h" | 25 #include "chrome/test/ui_test_utils.h" |
25 #include "googleurl/src/gurl.h" | 26 #include "googleurl/src/gurl.h" |
26 #include "webkit/glue/window_open_disposition.h" | 27 #include "webkit/glue/window_open_disposition.h" |
27 | 28 |
28 // Helper for accessing session service internals. | 29 // Helper for accessing session service internals. |
29 class TestSessionService | 30 class TestSessionService |
30 : public SessionServiceTestHelper, | 31 : public SessionServiceTestHelper, |
31 public base::RefCountedThreadSafe<TestSessionService> { | 32 public base::RefCountedThreadSafe<TestSessionService> { |
32 public: | 33 public: |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 browsers_.push_back(Browser::Create(GetProfile(i))); | 188 browsers_.push_back(Browser::Create(GetProfile(i))); |
188 } | 189 } |
189 | 190 |
190 return true; | 191 return true; |
191 } | 192 } |
192 | 193 |
193 // Open a single tab and return the TabContents. TabContents must be checked | 194 // Open a single tab and return the TabContents. TabContents must be checked |
194 // to ensure the tab opened successsfully. | 195 // to ensure the tab opened successsfully. |
195 TabContents* OpenTab(int index, GURL url) WARN_UNUSED_RESULT { | 196 TabContents* OpenTab(int index, GURL url) WARN_UNUSED_RESULT { |
196 TabContents* tab = GetBrowser(index)-> | 197 TabContents* tab = GetBrowser(index)-> |
197 AddSelectedTabWithURL(url, PageTransition::START_PAGE); | 198 AddSelectedTabWithURL(url, PageTransition::START_PAGE)->tab_contents(); |
198 | 199 |
199 // Wait for the page to finish loading. | 200 // Wait for the page to finish loading. |
200 ui_test_utils::WaitForNavigation( | 201 ui_test_utils::WaitForNavigation( |
201 &GetBrowser(index)->GetSelectedTabContents()->controller()); | 202 &GetBrowser(index)->GetSelectedTabContents()->controller()); |
202 | 203 |
203 return tab; | 204 return tab; |
204 } | 205 } |
205 | 206 |
206 // Creates and verifies the creation of a new window with one tab displaying | 207 // Creates and verifies the creation of a new window with one tab displaying |
207 // the specified GURL. | 208 // the specified GURL. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 MultipleClientLiveSessionsSyncTest() | 410 MultipleClientLiveSessionsSyncTest() |
410 : LiveSessionsSyncTest(MULTIPLE_CLIENT) {} | 411 : LiveSessionsSyncTest(MULTIPLE_CLIENT) {} |
411 virtual ~MultipleClientLiveSessionsSyncTest() {} | 412 virtual ~MultipleClientLiveSessionsSyncTest() {} |
412 | 413 |
413 private: | 414 private: |
414 DISALLOW_COPY_AND_ASSIGN(MultipleClientLiveSessionsSyncTest); | 415 DISALLOW_COPY_AND_ASSIGN(MultipleClientLiveSessionsSyncTest); |
415 }; | 416 }; |
416 | 417 |
417 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ | 418 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ |
418 | 419 |
OLD | NEW |