No longer register app window placement preference keys on
[chromium-blink-merge.git] / chrome / browser / ui / toolbar / recent_tabs_builder_test_helper.h
blob755ef130663fdb58ed98930896bc5b410c334382
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_
8 #include <vector>
10 #include "base/strings/string16.h"
11 #include "base/time/time.h"
12 #include "components/sessions/session_id.h"
14 namespace browser_sync {
15 class OpenTabsUIDelegate;
16 class SessionsSyncManager;
18 namespace sync_pb {
19 class SessionSpecifics;
22 // Utility class to help add recent tabs for testing.
23 class RecentTabsBuilderTestHelper {
24 public:
25 RecentTabsBuilderTestHelper();
26 ~RecentTabsBuilderTestHelper();
28 void AddSession();
29 int GetSessionCount();
30 SessionID::id_type GetSessionID(int session_index);
31 base::Time GetSessionTimestamp(int session_index);
33 void AddWindow(int session_index);
34 int GetWindowCount(int session_index);
35 SessionID::id_type GetWindowID(int session_index, int window_index);
37 void AddTab(int session_index, int window_index);
38 void AddTabWithInfo(int session_index,
39 int window_index,
40 base::Time timestamp,
41 const base::string16& title);
42 int GetTabCount(int session_index, int window_index);
43 SessionID::id_type GetTabID(int session_index,
44 int window_index,
45 int tab_index);
46 base::Time GetTabTimestamp(int session_index,
47 int window_index,
48 int tab_index);
49 base::string16 GetTabTitle(int session_index,
50 int window_index,
51 int tab_index);
53 void ExportToSessionsSyncManager(
54 browser_sync::SessionsSyncManager* manager);
56 std::vector<base::string16> GetTabTitlesSortedByRecency();
58 private:
59 void BuildSessionSpecifics(int session_index,
60 sync_pb::SessionSpecifics* meta);
61 void BuildWindowSpecifics(int session_index,
62 int window_index,
63 sync_pb::SessionSpecifics* meta);
64 void BuildTabSpecifics(int session_index,
65 int window_index,
66 int tab_index,
67 sync_pb::SessionSpecifics* tab_base);
68 void VerifyExport(browser_sync::OpenTabsUIDelegate* delegate);
70 struct TabInfo;
71 struct WindowInfo;
72 struct SessionInfo;
74 std::vector<SessionInfo> sessions_;
75 base::Time start_time_;
77 int max_tab_node_id_;
79 DISALLOW_COPY_AND_ASSIGN(RecentTabsBuilderTestHelper);
82 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_