OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_TYPES_TEST_HELPER_H_ | |
6 #define CHROME_BROWSER_SESSIONS_SESSION_TYPES_TEST_HELPER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/time.h" | |
11 #include "content/public/common/page_transition_types.h" | |
12 | |
13 class GURL; | |
14 class TabNavigation; | |
15 | |
16 namespace content { | |
17 struct Referrer; | |
18 } | |
19 | |
20 struct SessionTypesTestHelper { | |
21 // Compares everything except index, unique ID, post ID, and | |
22 // timestamp. | |
23 static void ExpectNavigationEquals(const TabNavigation& expected, | |
24 const TabNavigation& actual); | |
25 | |
26 // Create a TabNavigation with the given URL and title and some | |
27 // common values for the other fields. | |
28 static TabNavigation CreateNavigation(const std::string& virtual_url, | |
29 const std::string& title); | |
30 | |
31 // Getters. | |
32 | |
33 static const content::Referrer& GetReferrer(const TabNavigation& navigation); | |
34 | |
35 static content::PageTransition GetTransitionType( | |
36 const TabNavigation& navigation); | |
37 | |
38 static bool GetHasPostData(const TabNavigation& navigation); | |
39 | |
40 static int64 GetPostID(const TabNavigation& navigation); | |
41 | |
42 static const GURL& GetOriginalRequestURL(const TabNavigation& navigation); | |
43 | |
44 static bool GetIsOverridingUserAgent(const TabNavigation& navigation); | |
45 | |
46 static base::Time GetTimestamp(const TabNavigation& navigation); | |
47 | |
48 // Setters. | |
49 | |
50 static void SetContentState(TabNavigation* navigation, | |
51 const std::string& content_state); | |
52 | |
53 static void SetHasPostData(TabNavigation* navigation, | |
54 bool has_post_data); | |
55 | |
56 static void SetOriginalRequestURL(TabNavigation* navigation, | |
57 const GURL& original_request_url); | |
58 | |
59 static void SetIsOverridingUserAgent(TabNavigation* navigation, | |
60 bool is_overriding_user_agent); | |
61 | |
62 static void SetTimestamp(TabNavigation* navigation, base::Time timestamp); | |
63 }; | |
64 | |
65 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_TEST_HELPER_H_ | |
OLD | NEW |