| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/scoped_vector.h" | 5 #include "base/memory/scoped_vector.h" |
| 6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
| 7 #include "chrome/browser/sessions/session_service.h" | 7 #include "chrome/browser/sessions/session_service.h" |
| 8 #include "chrome/browser/sync/profile_sync_service_harness.h" | 8 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 9 #include "chrome/browser/sync/test/integration/sessions_helper.h" | 9 #include "chrome/browser/sync/test/integration/sessions_helper.h" |
| 10 #include "chrome/browser/sync/test/integration/sync_test.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 std::vector<ScopedWindowMap> client_windows(num_clients()); | 39 std::vector<ScopedWindowMap> client_windows(num_clients()); |
| 40 | 40 |
| 41 for (int i = 0; i < num_clients(); ++i) { | 41 for (int i = 0; i < num_clients(); ++i) { |
| 42 ASSERT_TRUE(CheckInitialState(i)); | 42 ASSERT_TRUE(CheckInitialState(i)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Open tabs on all clients and retain window information. | 45 // Open tabs on all clients and retain window information. |
| 46 for (int i = 0; i < num_clients(); ++i) { | 46 for (int i = 0; i < num_clients(); ++i) { |
| 47 SessionWindowMap windows; | 47 SessionWindowMap windows; |
| 48 ASSERT_TRUE(OpenTabAndGetLocalWindows( | 48 ASSERT_TRUE(OpenTabAndGetLocalWindows( |
| 49 i, GURL(StringPrintf("http://127.0.0.1/bubba%i", i)), &windows)); | 49 i, GURL(base::StringPrintf("http://127.0.0.1/bubba%i", i)), &windows)); |
| 50 client_windows[i].Reset(&windows); | 50 client_windows[i].Reset(&windows); |
| 51 } | 51 } |
| 52 | 52 |
| 53 // Wait for sync. | 53 // Wait for sync. |
| 54 ASSERT_TRUE(AwaitQuiescence()); | 54 ASSERT_TRUE(AwaitQuiescence()); |
| 55 | 55 |
| 56 // Get foreign session data from all clients and check it against all | 56 // Get foreign session data from all clients and check it against all |
| 57 // client_windows. | 57 // client_windows. |
| 58 for (int i = 0; i < num_clients(); ++i) { | 58 for (int i = 0; i < num_clients(); ++i) { |
| 59 ASSERT_TRUE(CheckForeignSessionsAgainst(i, client_windows)); | 59 ASSERT_TRUE(CheckForeignSessionsAgainst(i, client_windows)); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 75 // Wait for sync. | 75 // Wait for sync. |
| 76 // TODO(zea): Fix sync completion detection so we don't need this. For now, | 76 // TODO(zea): Fix sync completion detection so we don't need this. For now, |
| 77 // the profile sync service harness detects completion before all encryption | 77 // the profile sync service harness detects completion before all encryption |
| 78 // changes are propagated. | 78 // changes are propagated. |
| 79 ASSERT_TRUE(GetClient(0)->AwaitGroupSyncCycleCompletion(clients())); | 79 ASSERT_TRUE(GetClient(0)->AwaitGroupSyncCycleCompletion(clients())); |
| 80 | 80 |
| 81 // Open tabs on all clients and retain window information. | 81 // Open tabs on all clients and retain window information. |
| 82 for (int i = 0; i < num_clients(); ++i) { | 82 for (int i = 0; i < num_clients(); ++i) { |
| 83 SessionWindowMap windows; | 83 SessionWindowMap windows; |
| 84 ASSERT_TRUE(OpenTabAndGetLocalWindows( | 84 ASSERT_TRUE(OpenTabAndGetLocalWindows( |
| 85 i, GURL(StringPrintf("http://127.0.0.1/bubba%i", i)), &windows)); | 85 i, GURL(base::StringPrintf("http://127.0.0.1/bubba%i", i)), &windows)); |
| 86 client_windows[i].Reset(&windows); | 86 client_windows[i].Reset(&windows); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Wait for sync. | 89 // Wait for sync. |
| 90 ASSERT_TRUE(AwaitQuiescence()); | 90 ASSERT_TRUE(AwaitQuiescence()); |
| 91 | 91 |
| 92 // Get foreign session data from all clients and check it against all | 92 // Get foreign session data from all clients and check it against all |
| 93 // client_windows. | 93 // client_windows. |
| 94 for (int i = 0; i < num_clients(); ++i) { | 94 for (int i = 0; i < num_clients(); ++i) { |
| 95 ASSERT_TRUE(IsEncrypted(i, syncer::SESSIONS)); | 95 ASSERT_TRUE(IsEncrypted(i, syncer::SESSIONS)); |
| 96 ASSERT_TRUE(CheckForeignSessionsAgainst(i, client_windows)); | 96 ASSERT_TRUE(CheckForeignSessionsAgainst(i, client_windows)); |
| 97 } | 97 } |
| 98 } | 98 } |
| OLD | NEW |