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

Unified Diff: chrome/test/live_sync/two_client_live_sessions_sync_test.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/live_sync/multiple_client_live_sessions_sync_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/two_client_live_sessions_sync_test.cc
diff --git a/chrome/test/live_sync/two_client_live_sessions_sync_test.cc b/chrome/test/live_sync/two_client_live_sessions_sync_test.cc
index 7294c07f36e9cb2d9bd9d1efc333514ab2152c06..86f97cf266fbcefed67242dfd03670c3a74d93ea 100644
--- a/chrome/test/live_sync/two_client_live_sessions_sync_test.cc
+++ b/chrome/test/live_sync/two_client_live_sessions_sync_test.cc
@@ -6,7 +6,7 @@
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/test/live_sync/live_sessions_sync_test.h"
-// @TODO(zea): Test each individual session command we care about separately.
+// TODO(zea): Test each individual session command we care about separately.
// (as well as multi-window). We're currently only checking basic single-window/
// single-tab functionality.
@@ -31,6 +31,56 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveSessionsSyncTest, SingleClientChanged) {
ASSERT_TRUE(WindowsMatch(sessions1[0]->windows, *client0_windows));
}
+IN_PROC_BROWSER_TEST_F(TwoClientLiveSessionsSyncTest,
+ SingleClientEnabledEncryption) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ ASSERT_TRUE(CheckInitialState(0));
+ ASSERT_TRUE(CheckInitialState(1));
+
+ ASSERT_TRUE(EnableEncryption(0));
+ GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1));
+ ASSERT_TRUE(IsEncrypted(0));
+ ASSERT_TRUE(IsEncrypted(1));
+}
+
+IN_PROC_BROWSER_TEST_F(TwoClientLiveSessionsSyncTest,
+ SingleClientEnabledEncryptionAndChanged) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ ASSERT_TRUE(CheckInitialState(0));
+ ASSERT_TRUE(CheckInitialState(1));
+
+ std::vector<SessionWindow*>* client0_windows =
+ InitializeNewWindowWithTab(0, GURL("about:bubba"));
+ ASSERT_TRUE(client0_windows);
+ ASSERT_TRUE(EnableEncryption(0));
+ GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1));
+
+ // Get foreign session data from client 1.
+ ASSERT_TRUE(IsEncrypted(1));
+ std::vector<const ForeignSession*> sessions1;
+ ASSERT_TRUE(GetSessionData(1, &sessions1));
+
+ // Verify client 1's foreign session matches client 0 current window.
+ ASSERT_EQ(1U, sessions1.size());
+ ASSERT_TRUE(WindowsMatch(sessions1[0]->windows, *client0_windows));
+}
+
+IN_PROC_BROWSER_TEST_F(TwoClientLiveSessionsSyncTest,
+ BothClientsEnabledEncryption) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ ASSERT_TRUE(CheckInitialState(0));
+ ASSERT_TRUE(CheckInitialState(1));
+
+ ASSERT_TRUE(EnableEncryption(0));
+ ASSERT_TRUE(EnableEncryption(1));
+ GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1));
+ ASSERT_TRUE(IsEncrypted(0));
+ ASSERT_TRUE(IsEncrypted(1));
+}
+
IN_PROC_BROWSER_TEST_F(TwoClientLiveSessionsSyncTest, BothChanged) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
« no previous file with comments | « chrome/test/live_sync/multiple_client_live_sessions_sync_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698