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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Compares a foreign session based on the first session window. | 64 // Compares a foreign session based on the first session window. |
65 // Returns true based on the comparison of the session windows. | 65 // Returns true based on the comparison of the session windows. |
66 bool CompareSyncedSessions(const browser_sync::SyncedSession* lhs, | 66 bool CompareSyncedSessions(const browser_sync::SyncedSession* lhs, |
67 const browser_sync::SyncedSession* rhs); | 67 const browser_sync::SyncedSession* rhs); |
68 | 68 |
69 // Sort a SyncedSession vector using our custom SyncedSession comparator. | 69 // Sort a SyncedSession vector using our custom SyncedSession comparator. |
70 void SortSyncedSessions(SyncedSessionVector* sessions); | 70 void SortSyncedSessions(SyncedSessionVector* sessions); |
71 | 71 |
72 // Compares two tab navigations base on the parameters we sync. | 72 // Compares two tab navigations base on the parameters we sync. |
73 // (Namely, we don't sync state or type mask) | 73 // (Namely, we don't sync state or type mask) |
74 bool NavigationEquals(const TabNavigation& expected, | 74 bool NavigationEquals(const sessions::SerializedNavigationEntry& expected, |
75 const TabNavigation& actual); | 75 const sessions::SerializedNavigationEntry& actual); |
76 | 76 |
77 // Verifies that two SessionWindows match. | 77 // Verifies that two SessionWindows match. |
78 // Returns: | 78 // Returns: |
79 // - true if all the following match: | 79 // - true if all the following match: |
80 // 1. number of SessionWindows, | 80 // 1. number of SessionWindows, |
81 // 2. number of tabs per SessionWindow, | 81 // 2. number of tabs per SessionWindow, |
82 // 3. number of tab navigations per tab, | 82 // 3. number of tab navigations per tab, |
83 // 4. actual tab navigations contents | 83 // 4. actual tab navigations contents |
84 // - false otherwise. | 84 // - false otherwise. |
85 bool WindowsMatch(const SessionWindowMap& win1, | 85 bool WindowsMatch(const SessionWindowMap& win1, |
(...skipping 29 matching lines...) Expand all Loading... |
115 | 115 |
116 // Deletes the foreign session with tag |session_tag| from the profile specified | 116 // Deletes the foreign session with tag |session_tag| from the profile specified |
117 // by |index|. This will affect all synced clients. | 117 // by |index|. This will affect all synced clients. |
118 // Note: We pass the session_tag in by value to ensure it's not a reference | 118 // Note: We pass the session_tag in by value to ensure it's not a reference |
119 // to the session tag within the SyncedSession we plan to delete. | 119 // to the session tag within the SyncedSession we plan to delete. |
120 void DeleteForeignSession(int index, std::string session_tag); | 120 void DeleteForeignSession(int index, std::string session_tag); |
121 | 121 |
122 } // namespace sessions_helper | 122 } // namespace sessions_helper |
123 | 123 |
124 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_ | 124 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_ |
OLD | NEW |