| 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 <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 using SessionWindowMap = std::map<SessionID::id_type, sessions::SessionWindow*>; | 26 using SessionWindowMap = std::map<SessionID::id_type, sessions::SessionWindow*>; |
| 27 using ScopedWindowMap = | 27 using ScopedWindowMap = |
| 28 std::map<SessionID::id_type, std::unique_ptr<sessions::SessionWindow>>; | 28 std::map<SessionID::id_type, std::unique_ptr<sessions::SessionWindow>>; |
| 29 | 29 |
| 30 // Copies the local session windows of profile |index| to |local_windows|. | 30 // Copies the local session windows of profile |index| to |local_windows|. |
| 31 // Returns true if successful. | 31 // Returns true if successful. |
| 32 bool GetLocalWindows(int index, ScopedWindowMap* local_windows); | 32 bool GetLocalWindows(int index, ScopedWindowMap* local_windows); |
| 33 | 33 |
| 34 // Creates and verifies the creation of a new window for profile |index| with | 34 // Creates and verifies the creation of a new window for profile |index| with |
| 35 // one tab displaying |url|. Copies the SessionWindow associated with the new | 35 // one tab displaying |url|. Copies the SessionWindow associated with the new |
| 36 // window to |local_windows|. Returns true if successful. | 36 // window to |local_windows|. Returns true if successful. This call results in |
| 37 // multiple sessions changes, and performs synchronous blocking. It is rare, but |
| 38 // possible, that multiple sync cycle commits occur as a result of this call. |
| 39 // Test cases should be written to handle this possibility, otherwise they may |
| 40 // flake. |
| 37 bool OpenTabAndGetLocalWindows(int index, | 41 bool OpenTabAndGetLocalWindows(int index, |
| 38 const GURL& url, | 42 const GURL& url, |
| 39 ScopedWindowMap* local_windows); | 43 ScopedWindowMap* local_windows); |
| 40 | 44 |
| 41 // Checks that window count and foreign session count are 0. | 45 // Checks that window count and foreign session count are 0. |
| 42 bool CheckInitialState(int index); | 46 bool CheckInitialState(int index); |
| 43 | 47 |
| 44 // Returns number of open windows for a profile. | 48 // Returns number of open windows for a profile. |
| 45 int GetNumWindows(int index); | 49 int GetNumWindows(int index); |
| 46 | 50 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // StatusChangeChecker implementation. | 127 // StatusChangeChecker implementation. |
| 124 bool IsExitConditionSatisfied() override; | 128 bool IsExitConditionSatisfied() override; |
| 125 std::string GetDebugMessage() const override; | 129 std::string GetDebugMessage() const override; |
| 126 | 130 |
| 127 private: | 131 private: |
| 128 int index_; | 132 int index_; |
| 129 const std::vector<sessions_helper::ScopedWindowMap>& windows_; | 133 const std::vector<sessions_helper::ScopedWindowMap>& windows_; |
| 130 }; | 134 }; |
| 131 | 135 |
| 132 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_ | 136 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_ |
| OLD | NEW |