blob: 8e5ac1b3702dd8de5e5d63952700072ac6487d64 [file] [log] [blame]
Mikel Astize5d23562018-04-10 14:44:511// 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 Astiz5e4a71b2018-04-12 11:57:308#include <map>
Mikel Astize5d23562018-04-10 14:44:519#include <string>
10#include <vector>
11
12#include "components/sync/protocol/session_specifics.pb.h"
13#include "testing/gmock/include/gmock/gmock.h"
14
15namespace sync_sessions {
16
17struct SyncedSession;
18
19testing::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.
25testing::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
30testing::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 Astiz5e4a71b2018-04-12 11:57:3034 testing::Matcher<int> tab_node_id,
Mikel Astize5d23562018-04-10 14:44:5135 testing::Matcher<std::vector<std::string>> urls);
36
37// Convenience overload.
38testing::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 Astiz5e4a71b2018-04-12 11:57:3042 testing::Matcher<int> tab_node_id,
Mikel Astize5d23562018-04-10 14:44:5143 const std::vector<std::string>& urls);
44
45testing::Matcher<const SyncedSession*> MatchesSyncedSession(
46 testing::Matcher<std::string> session_tag,
Mikel Astiz5e4a71b2018-04-12 11:57:3047 testing::Matcher<std::map<int, std::vector<int>>> window_id_to_tabs);
Mikel Astize5d23562018-04-10 14:44:5148
49// Convenience overload.
50testing::Matcher<const SyncedSession*> MatchesSyncedSession(
51 testing::Matcher<std::string> session_tag,
Mikel Astiz5e4a71b2018-04-12 11:57:3052 const std::map<int, std::vector<int>>& window_id_to_tabs);
Mikel Astize5d23562018-04-10 14:44:5153
54} // namespace sync_sessions
55
56#endif // COMPONENTS_SYNC_SESSIONS_TEST_MATCHERS_H_