Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / components / sessions / serialized_navigation_entry_test_helper.h
bloba653f22d67e625135ef1e425d86c3464fcd29c12
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_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "content/public/common/page_transition_types.h"
13 class GURL;
15 namespace base {
16 class Time;
19 namespace content {
20 class PageState;
21 struct Referrer;
24 namespace sessions {
26 class SerializedNavigationEntry;
28 // Set of test functions to manipulate a SerializedNavigationEntry.
29 class 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);
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);
57 private:
58 DISALLOW_IMPLICIT_CONSTRUCTORS(SerializedNavigationEntryTestHelper);
61 } // sessions
63 #endif // COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_