1 // 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.
5 #ifndef COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_
6 #define COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_
10 #include "base/basictypes.h"
11 #include "content/public/common/page_transition_types.h"
26 class SerializedNavigationEntry
;
28 // Set of test functions to manipulate a SerializedNavigationEntry.
29 class SerializedNavigationEntryTestHelper
{
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
);
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
);
42 static void SetPageState(const content::PageState
& page_state
,
43 SerializedNavigationEntry
* navigation
);
45 static void SetHasPostData(bool has_post_data
,
46 SerializedNavigationEntry
* navigation
);
48 static void SetOriginalRequestURL(const GURL
& original_request_url
,
49 SerializedNavigationEntry
* navigation
);
51 static void SetIsOverridingUserAgent(bool is_overriding_user_agent
,
52 SerializedNavigationEntry
* navigation
);
54 static void SetTimestamp(base::Time timestamp
,
55 SerializedNavigationEntry
* navigation
);
58 DISALLOW_IMPLICIT_CONSTRUCTORS(SerializedNavigationEntryTestHelper
);
63 #endif // COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_