Mikel Astiz | e5d2356 | 2018-04-10 14:44:51 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef COMPONENTS_SYNC_SESSIONS_TEST_MATCHERS_H_ |
| 6 | #define COMPONENTS_SYNC_SESSIONS_TEST_MATCHERS_H_ |
| 7 | |
Mikel Astiz | 5e4a71b | 2018-04-12 11:57:30 | [diff] [blame] | 8 | #include <map> |
Mikel Astiz | e5d2356 | 2018-04-10 14:44:51 | [diff] [blame] | 9 | #include <string> |
| 10 | #include <vector> |
| 11 | |
| 12 | #include "components/sync/protocol/session_specifics.pb.h" |
| 13 | #include "testing/gmock/include/gmock/gmock.h" |
| 14 | |
| 15 | namespace sync_sessions { |
| 16 | |
| 17 | struct SyncedSession; |
| 18 | |
| 19 | testing::Matcher<const sync_pb::SessionSpecifics&> MatchesHeader( |
| 20 | testing::Matcher<std::string> session_tag, |
| 21 | testing::Matcher<std::vector<int>> window_ids, |
| 22 | testing::Matcher<std::vector<int>> tab_ids); |
| 23 | |
| 24 | // Convenience overload. |
| 25 | testing::Matcher<const sync_pb::SessionSpecifics&> MatchesHeader( |
| 26 | testing::Matcher<std::string> session_tag, |
| 27 | const std::vector<int>& window_ids, |
| 28 | const std::vector<int>& tab_ids); |
| 29 | |
| 30 | testing::Matcher<const sync_pb::SessionSpecifics&> MatchesTab( |
| 31 | testing::Matcher<std::string> session_tag, |
| 32 | testing::Matcher<int> window_id, |
| 33 | testing::Matcher<int> tab_id, |
Mikel Astiz | 5e4a71b | 2018-04-12 11:57:30 | [diff] [blame] | 34 | testing::Matcher<int> tab_node_id, |
Mikel Astiz | e5d2356 | 2018-04-10 14:44:51 | [diff] [blame] | 35 | testing::Matcher<std::vector<std::string>> urls); |
| 36 | |
| 37 | // Convenience overload. |
| 38 | testing::Matcher<const sync_pb::SessionSpecifics&> MatchesTab( |
| 39 | testing::Matcher<std::string> session_tag, |
| 40 | testing::Matcher<int> window_id, |
| 41 | testing::Matcher<int> tab_id, |
Mikel Astiz | 5e4a71b | 2018-04-12 11:57:30 | [diff] [blame] | 42 | testing::Matcher<int> tab_node_id, |
Mikel Astiz | e5d2356 | 2018-04-10 14:44:51 | [diff] [blame] | 43 | const std::vector<std::string>& urls); |
| 44 | |
| 45 | testing::Matcher<const SyncedSession*> MatchesSyncedSession( |
| 46 | testing::Matcher<std::string> session_tag, |
Mikel Astiz | 5e4a71b | 2018-04-12 11:57:30 | [diff] [blame] | 47 | testing::Matcher<std::map<int, std::vector<int>>> window_id_to_tabs); |
Mikel Astiz | e5d2356 | 2018-04-10 14:44:51 | [diff] [blame] | 48 | |
| 49 | // Convenience overload. |
| 50 | testing::Matcher<const SyncedSession*> MatchesSyncedSession( |
| 51 | testing::Matcher<std::string> session_tag, |
Mikel Astiz | 5e4a71b | 2018-04-12 11:57:30 | [diff] [blame] | 52 | const std::map<int, std::vector<int>>& window_id_to_tabs); |
Mikel Astiz | e5d2356 | 2018-04-10 14:44:51 | [diff] [blame] | 53 | |
| 54 | } // namespace sync_sessions |
| 55 | |
| 56 | #endif // COMPONENTS_SYNC_SESSIONS_TEST_MATCHERS_H_ |