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 "chrome/browser/sessions/session_service.h" | 6 #include "chrome/browser/sessions/session_service.h" |
7 #include "chrome/browser/sync/test/integration/passwords_helper.h" | 7 #include "chrome/browser/sync/test/integration/passwords_helper.h" |
8 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 8 #include "chrome/browser/sync/test/integration/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" |
11 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" | 11 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
12 | 12 |
13 using passwords_helper::SetDecryptionPassphrase; | 13 using passwords_helper::SetDecryptionPassphrase; |
14 using passwords_helper::SetEncryptionPassphrase; | 14 using passwords_helper::SetEncryptionPassphrase; |
15 using sessions_helper::CheckInitialState; | 15 using sessions_helper::CheckInitialState; |
16 using sessions_helper::DeleteForeignSession; | 16 using sessions_helper::DeleteForeignSession; |
17 using sessions_helper::GetLocalWindows; | 17 using sessions_helper::GetLocalWindows; |
18 using sessions_helper::GetSessionData; | 18 using sessions_helper::GetSessionData; |
19 using sessions_helper::OpenTabAndGetLocalWindows; | 19 using sessions_helper::OpenTabAndGetLocalWindows; |
20 using sessions_helper::ScopedWindowMap; | 20 using sessions_helper::ScopedWindowMap; |
21 using sessions_helper::SyncedSessionVector; | 21 using sessions_helper::SyncedSessionVector; |
22 using sessions_helper::WindowsMatch; | 22 using sessions_helper::WindowsMatch; |
23 | 23 |
24 class TwoClientSessionsSyncTest : public SyncTest { | 24 class TwoClientSessionsSyncTest : public SyncTest { |
25 public: | 25 public: |
26 TwoClientSessionsSyncTest() : SyncTest(TWO_CLIENT) {} | 26 TwoClientSessionsSyncTest() : SyncTest(TWO_CLIENT) {} |
27 virtual ~TwoClientSessionsSyncTest() {} | 27 ~TwoClientSessionsSyncTest() override {} |
28 | 28 |
29 private: | 29 private: |
30 DISALLOW_COPY_AND_ASSIGN(TwoClientSessionsSyncTest); | 30 DISALLOW_COPY_AND_ASSIGN(TwoClientSessionsSyncTest); |
31 }; | 31 }; |
32 | 32 |
33 static const char* kURL1 = "http://127.0.0.1/bubba1"; | 33 static const char* kURL1 = "http://127.0.0.1/bubba1"; |
34 static const char* kURL2 = "http://127.0.0.1/bubba2"; | 34 static const char* kURL2 = "http://127.0.0.1/bubba2"; |
35 | 35 |
36 // TODO(zea): Test each individual session command we care about separately. | 36 // TODO(zea): Test each individual session command we care about separately. |
37 // (as well as multi-window). We're currently only checking basic single-window/ | 37 // (as well as multi-window). We're currently only checking basic single-window/ |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 ASSERT_FALSE(GetSessionData(1, &sessions1)); | 207 ASSERT_FALSE(GetSessionData(1, &sessions1)); |
208 | 208 |
209 // Client 0 becomes active again with a new tab. | 209 // Client 0 becomes active again with a new tab. |
210 ASSERT_TRUE(OpenTabAndGetLocalWindows(0, GURL(kURL2), | 210 ASSERT_TRUE(OpenTabAndGetLocalWindows(0, GURL(kURL2), |
211 client0_windows.GetMutable())); | 211 client0_windows.GetMutable())); |
212 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 212 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
213 ASSERT_TRUE(GetSessionData(1, &sessions1)); | 213 ASSERT_TRUE(GetSessionData(1, &sessions1)); |
214 ASSERT_EQ(1U, sessions1.size()); | 214 ASSERT_EQ(1U, sessions1.size()); |
215 ASSERT_TRUE(WindowsMatch(sessions1[0]->windows, *client0_windows.Get())); | 215 ASSERT_TRUE(WindowsMatch(sessions1[0]->windows, *client0_windows.Get())); |
216 } | 216 } |
OLD | NEW |