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

Side by Side Diff: chrome/test/live_sync/multiple_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: Self review 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) 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 #include "base/stringprintf.h" 5 #include "base/stringprintf.h"
6 #include "chrome/test/live_sync/live_sessions_sync_test.h" 6 #include "chrome/test/live_sync/live_sessions_sync_test.h"
7 7
8 IN_PROC_BROWSER_TEST_F(MultipleClientLiveSessionsSyncTest, AllChanged) { 8 IN_PROC_BROWSER_TEST_F(MultipleClientLiveSessionsSyncTest, AllChanged) {
9 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 9 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
10 std::vector<std::vector<SessionWindow*>* > client_windows; 10 std::vector<std::vector<SessionWindow*>* > client_windows;
(...skipping 13 matching lines...) Expand all
24 // Wait for sync. 24 // Wait for sync.
25 ASSERT_TRUE(AwaitQuiescence()); 25 ASSERT_TRUE(AwaitQuiescence());
26 26
27 // Get foreign session data from all clients and check it against all 27 // Get foreign session data from all clients and check it against all
28 // client_windows. 28 // client_windows.
29 for (int i = 0; i < num_clients(); ++i) { 29 for (int i = 0; i < num_clients(); ++i) {
30 ASSERT_TRUE(CheckForeignSessionsAgainst(i, client_windows)); 30 ASSERT_TRUE(CheckForeignSessionsAgainst(i, client_windows));
31 } 31 }
32 } 32 }
33 33
34 IN_PROC_BROWSER_TEST_F(MultipleClientLiveSessionsSyncTest,
35 EncryptedAndChanged) {
36 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
37 std::vector<std::vector<SessionWindow*>* > client_windows;
38
39 for (int i = 0; i < num_clients(); ++i) {
40 ASSERT_TRUE(CheckInitialState(i));
41 }
42
43 // Enable encryption on client 0, should propagate to all other clients.
44 ASSERT_TRUE(EnableEncryption(0));
45
46 // Wait for sync.
47 // TODO(zea): Fix sync completion detection so we don't need this. For now,
48 // the profile sync service harness detects completion before all encryption
49 // changes are propagated.
50 ASSERT_TRUE(AwaitQuiescence());
51
52 // Open tabs on all clients and retain window information.
53 for (int i = 0; i < num_clients(); ++i) {
54 std::vector<SessionWindow*>* new_windows =
55 InitializeNewWindowWithTab(i, GURL(StringPrintf("about:bubba%i", i)));
56 ASSERT_TRUE(new_windows);
57 client_windows.push_back(new_windows);
58 }
59
60 // Wait for sync.
61 ASSERT_TRUE(AwaitQuiescence());
62
63 // Get foreign session data from all clients and check it against all
64 // client_windows.
65 for (int i = 0; i < num_clients(); ++i) {
66 ASSERT_TRUE(IsEncrypted(i));
67 ASSERT_TRUE(CheckForeignSessionsAgainst(i, client_windows));
68 }
69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698