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"
25 class SerializedNavigationEntry
;
27 // Set of test functions to manipulate a SerializedNavigationEntry.
28 class SerializedNavigationEntryTestHelper
{
30 // Compares the two entries. This uses EXPECT_XXX on each member, if your test
31 // needs to stop after this wrap calls to this in EXPECT_NO_FATAL_FAILURE.
32 static void ExpectNavigationEquals(const SerializedNavigationEntry
& expected
,
33 const SerializedNavigationEntry
& actual
);
35 // Create a SerializedNavigationEntry with the given URL and title and some
36 // common values for the other fields.
37 static SerializedNavigationEntry
CreateNavigation(
38 const std::string
& virtual_url
,
39 const std::string
& title
);
41 static void SetPageState(const content::PageState
& page_state
,
42 SerializedNavigationEntry
* navigation
);
44 static void SetHasPostData(bool has_post_data
,
45 SerializedNavigationEntry
* navigation
);
47 static void SetOriginalRequestURL(const GURL
& original_request_url
,
48 SerializedNavigationEntry
* navigation
);
50 static void SetIsOverridingUserAgent(bool is_overriding_user_agent
,
51 SerializedNavigationEntry
* navigation
);
53 static void SetTimestamp(base::Time timestamp
,
54 SerializedNavigationEntry
* navigation
);
57 DISALLOW_IMPLICIT_CONSTRUCTORS(SerializedNavigationEntryTestHelper
);
62 #endif // COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_