Chromium Code Reviews| Index: components/sessions/serialized_navigation_entry_test_helper.cc |
| diff --git a/chrome/browser/sessions/session_types_test_helper.cc b/components/sessions/serialized_navigation_entry_test_helper.cc |
| similarity index 47% |
| rename from chrome/browser/sessions/session_types_test_helper.cc |
| rename to components/sessions/serialized_navigation_entry_test_helper.cc |
| index f735ab7ea91c6ada05fdef375c844c5ada0d9525..696a61491411244d0914ae0f4bcd4df6ec9418ab 100644 |
| --- a/chrome/browser/sessions/session_types_test_helper.cc |
| +++ b/components/sessions/serialized_navigation_entry_test_helper.cc |
| @@ -1,18 +1,22 @@ |
| // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
Jói
2013/04/26 21:55:47
2013?
|
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/sessions/session_types_test_helper.h" |
| -#include "base/basictypes.h" |
| +#include "components/sessions/serialized_navigation_entry_test_helper.h" |
| + |
| +#include "base/time.h" |
| #include "base/utf_string_conversions.h" |
| -#include "chrome/browser/sessions/session_types.h" |
| +#include "components/sessions/serialized_navigation_entry.h" |
| #include "googleurl/src/gurl.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h" |
| -void SessionTypesTestHelper::ExpectNavigationEquals( |
| - const TabNavigation& expected, |
| - const TabNavigation& actual) { |
| +namespace components { |
| + |
| +// static |
| +void SerializedNavigationEntryTestHelper::ExpectNavigationEquals( |
| + const SerializedNavigationEntry& expected, |
| + const SerializedNavigationEntry& actual) { |
| EXPECT_EQ(expected.referrer_.url, actual.referrer_.url); |
| EXPECT_EQ(expected.referrer_.policy, actual.referrer_.policy); |
| EXPECT_EQ(expected.virtual_url_, actual.virtual_url_); |
| @@ -25,10 +29,11 @@ void SessionTypesTestHelper::ExpectNavigationEquals( |
| actual.is_overriding_user_agent_); |
| } |
| -TabNavigation SessionTypesTestHelper::CreateNavigation( |
| +// static |
| +SerializedNavigationEntry SerializedNavigationEntryTestHelper::CreateNavigation( |
| const std::string& virtual_url, |
| const std::string& title) { |
| - TabNavigation navigation; |
| + SerializedNavigationEntry navigation; |
| navigation.index_ = 0; |
| navigation.referrer_ = |
| content::Referrer(GURL("http://www.referrer.com"), |
| @@ -40,64 +45,39 @@ TabNavigation SessionTypesTestHelper::CreateNavigation( |
| return navigation; |
| } |
| -const content::Referrer& SessionTypesTestHelper::GetReferrer( |
| - const TabNavigation& navigation) { |
| - return navigation.referrer_; |
| -} |
| - |
| -content::PageTransition SessionTypesTestHelper::GetTransitionType( |
| - const TabNavigation& navigation) { |
| - return navigation.transition_type_; |
| -} |
| - |
| -bool SessionTypesTestHelper::GetHasPostData(const TabNavigation& navigation) { |
| - return navigation.has_post_data_; |
| -} |
| - |
| -int64 SessionTypesTestHelper::GetPostID(const TabNavigation& navigation) { |
| - return navigation.post_id_; |
| -} |
| - |
| -const GURL& SessionTypesTestHelper::GetOriginalRequestURL( |
| - const TabNavigation& navigation) { |
| - return navigation.original_request_url_; |
| -} |
| - |
| -bool SessionTypesTestHelper::GetIsOverridingUserAgent( |
| - const TabNavigation& navigation) { |
| - return navigation.is_overriding_user_agent_; |
| -} |
| - |
| -base::Time SessionTypesTestHelper::GetTimestamp( |
| - const TabNavigation& navigation) { |
| - return navigation.timestamp_; |
| -} |
| - |
| -void SessionTypesTestHelper::SetContentState( |
| - TabNavigation* navigation, |
| - const std::string& content_state) { |
| +// static |
| +void SerializedNavigationEntryTestHelper::SetContentState( |
| + const std::string& content_state, |
| + SerializedNavigationEntry* navigation) { |
| navigation->content_state_ = content_state; |
| } |
| -void SessionTypesTestHelper::SetHasPostData(TabNavigation* navigation, |
| - bool has_post_data) { |
| +// static |
| +void SerializedNavigationEntryTestHelper::SetHasPostData( |
| + bool has_post_data, |
| + SerializedNavigationEntry* navigation) { |
| navigation->has_post_data_ = has_post_data; |
| } |
| -void SessionTypesTestHelper::SetOriginalRequestURL( |
| - TabNavigation* navigation, |
| - const GURL& original_request_url) { |
| +// static |
| +void SerializedNavigationEntryTestHelper::SetOriginalRequestURL( |
| + const GURL& original_request_url, |
| + SerializedNavigationEntry* navigation) { |
| navigation->original_request_url_ = original_request_url; |
| } |
| -void SessionTypesTestHelper::SetIsOverridingUserAgent( |
| - TabNavigation* navigation, |
| - bool is_overriding_user_agent) { |
| +// static |
| +void SerializedNavigationEntryTestHelper::SetIsOverridingUserAgent( |
| + bool is_overriding_user_agent, |
| + SerializedNavigationEntry* navigation) { |
| navigation->is_overriding_user_agent_ = is_overriding_user_agent; |
| } |
| -void SessionTypesTestHelper::SetTimestamp( |
| - TabNavigation* navigation, |
| - base::Time timestamp) { |
| +// static |
| +void SerializedNavigationEntryTestHelper::SetTimestamp( |
| + base::Time timestamp, |
| + SerializedNavigationEntry* navigation) { |
| navigation->timestamp_ = timestamp; |
| } |
| + |
| +} // namespace components |