• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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 CHROME_BROWSER_SYNC_GLUE_SESSION_SYNC_TEST_HELPER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SESSION_SYNC_TEST_HELPER_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "components/sessions/session_id.h"
12 
13 namespace sync_pb {
14 class SessionSpecifics;
15 }
16 
17 namespace browser_sync {
18 
19 struct SyncedSession;
20 
21 class SessionSyncTestHelper {
22  public:
SessionSyncTestHelper()23   SessionSyncTestHelper() : max_tab_node_id_(0) {}
24 
25   static void BuildSessionSpecifics(const std::string& tag,
26                                     sync_pb::SessionSpecifics* meta);
27 
28   static void AddWindowSpecifics(int window_id,
29                                  const std::vector<int>& tab_list,
30                                  sync_pb::SessionSpecifics* meta);
31 
32   static void VerifySyncedSession(
33       const std::string& tag,
34       const std::vector<std::vector<SessionID::id_type> >& windows,
35       const SyncedSession& session);
36 
37   void BuildTabSpecifics(const std::string& tag,
38                          int window_id,
39                          int tab_id,
40                          sync_pb::SessionSpecifics* tab_base);
41 
42   sync_pb::SessionSpecifics BuildForeignSession(
43       const std::string& tag,
44       const std::vector<SessionID::id_type>& tab_list,
45       std::vector<sync_pb::SessionSpecifics>* tabs);
46 
47   void Reset();
48 
49  private:
50   int max_tab_node_id_;
51   DISALLOW_COPY_AND_ASSIGN(SessionSyncTestHelper);
52 };
53 
54 }  // namespace browser_sync
55 
56 #endif  // CHROME_BROWSER_SYNC_GLUE_SESSION_SYNC_TEST_HELPER_H_
57