Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / toolbar / recent_tabs_builder_test_helper.h
blob4c093a0311ab06e5f23d2db0c8a554a1e81b4956
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 "chrome/browser/sessions/session_id.h"
14 namespace browser_sync {
15 class OpenTabsUIDelegate;
16 class SessionModelAssociator;
17 class SessionsSyncManager;
19 namespace sync_pb {
20 class SessionSpecifics;
23 // Utility class to help add recent tabs for testing.
24 class RecentTabsBuilderTestHelper {
25 public:
26 RecentTabsBuilderTestHelper();
27 ~RecentTabsBuilderTestHelper();
29 void AddSession();
30 int GetSessionCount();
31 SessionID::id_type GetSessionID(int session_index);
32 base::Time GetSessionTimestamp(int session_index);
34 void AddWindow(int session_index);
35 int GetWindowCount(int session_index);
36 SessionID::id_type GetWindowID(int session_index, int window_index);
38 void AddTab(int session_index, int window_index);
39 void AddTabWithInfo(int session_index,
40 int window_index,
41 base::Time timestamp,
42 const base::string16& title);
43 int GetTabCount(int session_index, int window_index);
44 SessionID::id_type GetTabID(int session_index,
45 int window_index,
46 int tab_index);
47 base::Time GetTabTimestamp(int session_index,
48 int window_index,
49 int tab_index);
50 base::string16 GetTabTitle(int session_index,
51 int window_index,
52 int tab_index);
54 void ExportToSessionModelAssociator(
55 browser_sync::SessionModelAssociator* associator);
56 void ExportToSessionsSyncManager(
57 browser_sync::SessionsSyncManager* manager);
59 std::vector<base::string16> GetTabTitlesSortedByRecency();
61 private:
62 void BuildSessionSpecifics(int session_index,
63 sync_pb::SessionSpecifics* meta);
64 void BuildWindowSpecifics(int session_index,
65 int window_index,
66 sync_pb::SessionSpecifics* meta);
67 void BuildTabSpecifics(int session_index,
68 int window_index,
69 int tab_index,
70 sync_pb::SessionSpecifics* tab_base);
71 void VerifyExport(browser_sync::OpenTabsUIDelegate* delegate);
73 struct TabInfo;
74 struct WindowInfo;
75 struct SessionInfo;
77 std::vector<SessionInfo> sessions_;
78 base::Time start_time_;
80 int max_tab_node_id_;
82 DISALLOW_COPY_AND_ASSIGN(RecentTabsBuilderTestHelper);
85 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_