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

Side by Side Diff: chrome/test/live_sync/live_sessions_sync_test.h

Issue 6465005: [Sync] Initial support for encrypting any datatype (no UI hookup yet). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + small fix Created 9 years, 10 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) 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"
19 #include "chrome/test/live_sync/live_sync_test.h" 21 #include "chrome/test/live_sync/live_sync_test.h"
20 22
21 class GURL; 23 class GURL;
22 class Profile; 24 class Profile;
23 class TabContents; 25 class TabContents;
24 26
25 // Helper for accessing session service internals. 27 // Helper for accessing session service internals.
26 class TestSessionService 28 class TestSessionService
27 : public SessionServiceTestHelper, 29 : public SessionServiceTestHelper,
28 public base::RefCountedThreadSafe<TestSessionService> { 30 public base::RefCountedThreadSafe<TestSessionService> {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Used to access the session service test helper associated with a specific 92 // Used to access the session service test helper associated with a specific
91 // sync profile. 93 // sync profile.
92 TestSessionService* GetHelper(int index); 94 TestSessionService* GetHelper(int index);
93 95
94 // Used to access the browser associated with a specific sync profile. 96 // Used to access the browser associated with a specific sync profile.
95 Browser* GetBrowser(int index); 97 Browser* GetBrowser(int index);
96 98
97 // Sets up the TestSessionService helper and the new browser windows. 99 // Sets up the TestSessionService helper and the new browser windows.
98 virtual bool SetupClients(); 100 virtual bool SetupClients();
99 101
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
100 // Open a single tab and return the TabContents. TabContents must be checked 112 // Open a single tab and return the TabContents. TabContents must be checked
101 // to ensure the tab opened successsfully. 113 // to ensure the tab opened successsfully.
102 TabContents* OpenTab(int index, GURL url) WARN_UNUSED_RESULT; 114 TabContents* OpenTab(int index, GURL url) WARN_UNUSED_RESULT;
103 115
104 // Creates and verifies the creation of a new window with one tab displaying 116 // Creates and verifies the creation of a new window with one tab displaying
105 // the specified GURL. 117 // the specified GURL.
106 // Returns: the SessionWindow associated with the new window. 118 // Returns: the SessionWindow associated with the new window.
107 std::vector<SessionWindow*>* InitializeNewWindowWithTab(int index, GURL url) 119 std::vector<SessionWindow*>* InitializeNewWindowWithTab(int index, GURL url)
108 WARN_UNUSED_RESULT; 120 WARN_UNUSED_RESULT;
109 121
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 public: 213 public:
202 MultipleClientLiveSessionsSyncTest() 214 MultipleClientLiveSessionsSyncTest()
203 : LiveSessionsSyncTest(MULTIPLE_CLIENT) {} 215 : LiveSessionsSyncTest(MULTIPLE_CLIENT) {}
204 virtual ~MultipleClientLiveSessionsSyncTest() {} 216 virtual ~MultipleClientLiveSessionsSyncTest() {}
205 217
206 private: 218 private:
207 DISALLOW_COPY_AND_ASSIGN(MultipleClientLiveSessionsSyncTest); 219 DISALLOW_COPY_AND_ASSIGN(MultipleClientLiveSessionsSyncTest);
208 }; 220 };
209 221
210 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_ 222 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SESSIONS_SYNC_TEST_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/live_sync/multiple_client_live_sessions_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698