blob: a653f22d67e625135ef1e425d86c3464fcd29c12 [file] [log] [blame]
[email protected]40a7e412013-04-29 18:13:011// Copyright (c) 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 COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_
6#define COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_
7
8#include <string>
9
10#include "base/basictypes.h"
11#include "content/public/common/page_transition_types.h"
12
13class GURL;
14
15namespace base {
16class Time;
17}
18
19namespace content {
[email protected]691aa2f2013-05-28 22:52:0420class PageState;
[email protected]40a7e412013-04-29 18:13:0121struct Referrer;
22}
23
24namespace sessions {
25
26class SerializedNavigationEntry;
27
28// Set of test functions to manipulate a SerializedNavigationEntry.
29class SerializedNavigationEntryTestHelper {
30 public:
31 // Compares the two entries. This uses EXPECT_XXX on each member, if your test
32 // needs to stop after this wrap calls to this in EXPECT_NO_FATAL_FAILURE.
33 static void ExpectNavigationEquals(const SerializedNavigationEntry& expected,
34 const SerializedNavigationEntry& actual);
35
36 // Create a SerializedNavigationEntry with the given URL and title and some
37 // common values for the other fields.
38 static SerializedNavigationEntry CreateNavigation(
39 const std::string& virtual_url,
40 const std::string& title);
41
[email protected]691aa2f2013-05-28 22:52:0442 static void SetPageState(const content::PageState& page_state,
43 SerializedNavigationEntry* navigation);
[email protected]40a7e412013-04-29 18:13:0144
45 static void SetHasPostData(bool has_post_data,
46 SerializedNavigationEntry* navigation);
47
48 static void SetOriginalRequestURL(const GURL& original_request_url,
49 SerializedNavigationEntry* navigation);
50
51 static void SetIsOverridingUserAgent(bool is_overriding_user_agent,
52 SerializedNavigationEntry* navigation);
53
54 static void SetTimestamp(base::Time timestamp,
55 SerializedNavigationEntry* navigation);
56
57 private:
58 DISALLOW_IMPLICIT_CONSTRUCTORS(SerializedNavigationEntryTestHelper);
59};
60
61} // sessions
62
63#endif // COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_