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