blob: ba2c891a8913ae77145f0b5aaf1582112c300495 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SESSIONS_SESSION_TYPES_TEST_HELPER_H_
#define CHROME_BROWSER_SESSIONS_SESSION_TYPES_TEST_HELPER_H_
#include <string>
#include "base/time.h"
#include "content/public/common/page_transition_types.h"
class GURL;
class TabNavigation;
namespace content {
struct Referrer;
}
struct SessionTypesTestHelper {
// Compares everything except index, unique ID, post ID, and
// timestamp.
static void ExpectNavigationEquals(const TabNavigation& expected,
const TabNavigation& actual);
// Create a TabNavigation with the given URL and title and some
// common values for the other fields.
static TabNavigation CreateNavigation(const std::string& virtual_url,
const std::string& title);
// Getters.
static const content::Referrer& GetReferrer(const TabNavigation& navigation);
static content::PageTransition GetTransitionType(
const TabNavigation& navigation);
static bool GetHasPostData(const TabNavigation& navigation);
static int64 GetPostID(const TabNavigation& navigation);
static const GURL& GetOriginalRequestURL(const TabNavigation& navigation);
static bool GetIsOverridingUserAgent(const TabNavigation& navigation);
static base::Time GetTimestamp(const TabNavigation& navigation);
// Setters.
static void SetContentState(TabNavigation* navigation,
const std::string& content_state);
static void SetHasPostData(TabNavigation* navigation,
bool has_post_data);
static void SetOriginalRequestURL(TabNavigation* navigation,
const GURL& original_request_url);
static void SetIsOverridingUserAgent(TabNavigation* navigation,
bool is_overriding_user_agent);
static void SetTimestamp(TabNavigation* navigation, base::Time timestamp);
};
#endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_TEST_HELPER_H_
|