| 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/history/history_types.h" | 6 #include "chrome/browser/history/history_types.h" |
| 7 #include "chrome/browser/sessions/session_service.h" | 7 #include "chrome/browser/sessions/session_service.h" |
| 8 #include "chrome/browser/sessions/session_types.h" | 8 #include "chrome/browser/sessions/session_types.h" |
| 9 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 9 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| 10 #include "chrome/browser/sync/test/integration/sessions_helper.h" | 10 #include "chrome/browser/sync/test/integration/sessions_helper.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, MAYBE_Sanity) { | 41 IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, MAYBE_Sanity) { |
| 42 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 42 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 43 | 43 |
| 44 ASSERT_TRUE(CheckInitialState(0)); | 44 ASSERT_TRUE(CheckInitialState(0)); |
| 45 | 45 |
| 46 // Add a new session to client 0 and wait for it to sync. | 46 // Add a new session to client 0 and wait for it to sync. |
| 47 ScopedWindowMap old_windows; | 47 ScopedWindowMap old_windows; |
| 48 ASSERT_TRUE(OpenTabAndGetLocalWindows(0, | 48 ASSERT_TRUE(OpenTabAndGetLocalWindows(0, |
| 49 GURL("http://127.0.0.1/bubba"), | 49 GURL("http://127.0.0.1/bubba"), |
| 50 old_windows.GetMutable())); | 50 old_windows.GetMutable())); |
| 51 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); | 51 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); |
| 52 | 52 |
| 53 // Get foreign session data from client 0. | 53 // Get foreign session data from client 0. |
| 54 SyncedSessionVector sessions; | 54 SyncedSessionVector sessions; |
| 55 ASSERT_FALSE(GetSessionData(0, &sessions)); | 55 ASSERT_FALSE(GetSessionData(0, &sessions)); |
| 56 ASSERT_EQ(0U, sessions.size()); | 56 ASSERT_EQ(0U, sessions.size()); |
| 57 | 57 |
| 58 // Verify client didn't change. | 58 // Verify client didn't change. |
| 59 ScopedWindowMap new_windows; | 59 ScopedWindowMap new_windows; |
| 60 ASSERT_TRUE(GetLocalWindows(0, new_windows.GetMutable())); | 60 ASSERT_TRUE(GetLocalWindows(0, new_windows.GetMutable())); |
| 61 ASSERT_TRUE(WindowsMatch(*old_windows.Get(), *new_windows.Get())); | 61 ASSERT_TRUE(WindowsMatch(*old_windows.Get(), *new_windows.Get())); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 for (std::vector<sessions::SerializedNavigationEntry>::const_iterator | 115 for (std::vector<sessions::SerializedNavigationEntry>::const_iterator |
| 116 it3 = (*it2)->navigations.begin(); | 116 it3 = (*it2)->navigations.begin(); |
| 117 it3 != (*it2)->navigations.end(); ++it3) { | 117 it3 != (*it2)->navigations.end(); ++it3) { |
| 118 EXPECT_EQ(200, it3->http_status_code()); | 118 EXPECT_EQ(200, it3->http_status_code()); |
| 119 ++found_navigations; | 119 ++found_navigations; |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 ASSERT_EQ(1, found_navigations); | 123 ASSERT_EQ(1, found_navigations); |
| 124 } | 124 } |
| OLD | NEW |