| 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 #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/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 16 #include "chrome/browser/sessions/base_session_service.h" | 16 #include "chrome/browser/sessions/base_session_service.h" |
| 17 #include "chrome/browser/sessions/session_service_test_helper.h" | 17 #include "chrome/browser/sessions/session_service_test_helper.h" |
| 18 #include "chrome/browser/sessions/session_types.h" | 18 #include "chrome/browser/sessions/session_types.h" |
| 19 #include "chrome/browser/sync/profile_sync_service_harness.h" | |
| 20 #include "chrome/browser/sync/syncable/nigori_util.h" | |
| 21 #include "chrome/test/live_sync/live_sync_test.h" | 19 #include "chrome/test/live_sync/live_sync_test.h" |
| 22 | 20 |
| 23 class GURL; | 21 class GURL; |
| 24 class Profile; | 22 class Profile; |
| 25 class TabContents; | 23 class TabContents; |
| 26 | 24 |
| 27 // Helper for accessing session service internals. | 25 // Helper for accessing session service internals. |
| 28 class TestSessionService | 26 class TestSessionService |
| 29 : public SessionServiceTestHelper, | 27 : public SessionServiceTestHelper, |
| 30 public base::RefCountedThreadSafe<TestSessionService> { | 28 public base::RefCountedThreadSafe<TestSessionService> { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Used to access the session service test helper associated with a specific | 90 // Used to access the session service test helper associated with a specific |
| 93 // sync profile. | 91 // sync profile. |
| 94 TestSessionService* GetHelper(int index); | 92 TestSessionService* GetHelper(int index); |
| 95 | 93 |
| 96 // Used to access the browser associated with a specific sync profile. | 94 // Used to access the browser associated with a specific sync profile. |
| 97 Browser* GetBrowser(int index); | 95 Browser* GetBrowser(int index); |
| 98 | 96 |
| 99 // Sets up the TestSessionService helper and the new browser windows. | 97 // Sets up the TestSessionService helper and the new browser windows. |
| 100 virtual bool SetupClients(); | 98 virtual bool SetupClients(); |
| 101 | 99 |
| 102 // Encrypt sessions datatype. | |
| 103 bool EnableEncryption(int index) { | |
| 104 return GetClient(index)->EnableEncryptionForType(syncable::SESSIONS); | |
| 105 } | |
| 106 | |
| 107 // Check if Sessions are encrypted. | |
| 108 bool IsEncrypted(int index) { | |
| 109 return GetClient(index)->IsTypeEncrypted(syncable::SESSIONS); | |
| 110 } | |
| 111 | |
| 112 // Open a single tab and return the TabContents. TabContents must be checked | 100 // Open a single tab and return the TabContents. TabContents must be checked |
| 113 // to ensure the tab opened successsfully. | 101 // to ensure the tab opened successsfully. |
| 114 TabContents* OpenTab(int index, GURL url) WARN_UNUSED_RESULT; | 102 TabContents* OpenTab(int index, GURL url) WARN_UNUSED_RESULT; |
| 115 | 103 |
| 116 // Creates and verifies the creation of a new window with one tab displaying | 104 // Creates and verifies the creation of a new window with one tab displaying |
| 117 // the specified GURL. | 105 // the specified GURL. |
| 118 // Returns: the SessionWindow associated with the new window. | 106 // Returns: the SessionWindow associated with the new window. |
| 119 std::vector<SessionWindow*>* InitializeNewWindowWithTab(int index, GURL url) | 107 std::vector<SessionWindow*>* InitializeNewWindowWithTab(int index, GURL url) |
| 120 WARN_UNUSED_RESULT; | 108 WARN_UNUSED_RESULT; |
| 121 | 109 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 public: | 201 public: |
| 214 MultipleClientLiveSessionsSyncTest() | 202 MultipleClientLiveSessionsSyncTest() |
| 215 : LiveSessionsSyncTest(MULTIPLE_CLIENT) {} | 203 : LiveSessionsSyncTest(MULTIPLE_CLIENT) {} |
| 216 virtual ~MultipleClientLiveSessionsSyncTest() {} | 204 virtual ~MultipleClientLiveSessionsSyncTest() {} |
| 217 | 205 |
| 218 private: | 206 private: |
| 219 DISALLOW_COPY_AND_ASSIGN(MultipleClientLiveSessionsSyncTest); | 207 DISALLOW_COPY_AND_ASSIGN(MultipleClientLiveSessionsSyncTest); |
| 220 }; | 208 }; |
| 221 | 209 |
| 222 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ | 210 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ |
| OLD | NEW |