Add owners for c/b/ui/views/accessibility
[chromium-blink-merge.git] / components / sessions / serialized_navigation_entry_test_helper.h
blob1044b0cb44ab431a05aa8e3b8127224f0171dbb7
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"
12 class GURL;
14 namespace base {
15 class Time;
18 namespace content {
19 class PageState;
20 struct Referrer;
23 namespace sessions {
25 class SerializedNavigationEntry;
27 // Set of test functions to manipulate a SerializedNavigationEntry.
28 class SerializedNavigationEntryTestHelper {
29 public:
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);
56 private:
57 DISALLOW_IMPLICIT_CONSTRUCTORS(SerializedNavigationEntryTestHelper);
60 } // sessions
62 #endif // COMPONENTS_SESSIONS_SESSION_TYPES_TEST_HELPER_H_