Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: components/sessions/core/serialized_navigation_entry_unittest.cc

Issue 2310363002: Persist offline page info in a navigation entry if needed (Closed)
Patch Set: Fix win compiling error due to using unique_ptr map in SESSIONS_EXPORT class Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sessions/core/serialized_navigation_entry.h" 5 #include "components/sessions/core/serialized_navigation_entry.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <memory> 10 #include <memory>
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 new_navigation.transition_type(), test_data::kTransitionType)); 125 new_navigation.transition_type(), test_data::kTransitionType));
126 EXPECT_EQ(test_data::kHasPostData, new_navigation.has_post_data()); 126 EXPECT_EQ(test_data::kHasPostData, new_navigation.has_post_data());
127 EXPECT_EQ(test_data::kOriginalRequestURL, 127 EXPECT_EQ(test_data::kOriginalRequestURL,
128 new_navigation.original_request_url()); 128 new_navigation.original_request_url());
129 EXPECT_EQ(test_data::kIsOverridingUserAgent, 129 EXPECT_EQ(test_data::kIsOverridingUserAgent,
130 new_navigation.is_overriding_user_agent()); 130 new_navigation.is_overriding_user_agent());
131 EXPECT_EQ(test_data::kTimestamp, new_navigation.timestamp()); 131 EXPECT_EQ(test_data::kTimestamp, new_navigation.timestamp());
132 EXPECT_EQ(test_data::kSearchTerms, new_navigation.search_terms()); 132 EXPECT_EQ(test_data::kSearchTerms, new_navigation.search_terms());
133 EXPECT_EQ(test_data::kHttpStatusCode, new_navigation.http_status_code()); 133 EXPECT_EQ(test_data::kHttpStatusCode, new_navigation.http_status_code());
134 134
135 ASSERT_EQ(2U, new_navigation.extended_info_map().size());
136 ASSERT_EQ(1U, new_navigation.extended_info_map().count(
137 test_data::kExtendedInfoKey1));
138 EXPECT_EQ(
139 test_data::kExtendedInfoValue1,
140 new_navigation.extended_info_map().at(test_data::kExtendedInfoKey1));
141 ASSERT_EQ(1U, new_navigation.extended_info_map().count(
142 test_data::kExtendedInfoKey2));
143 EXPECT_EQ(
144 test_data::kExtendedInfoValue2,
145 new_navigation.extended_info_map().at(test_data::kExtendedInfoKey2));
146
135 // Fields that are not written to the pickle. 147 // Fields that are not written to the pickle.
136 EXPECT_EQ(0, new_navigation.unique_id()); 148 EXPECT_EQ(0, new_navigation.unique_id());
137 EXPECT_EQ(std::string(), new_navigation.encoded_page_state()); 149 EXPECT_EQ(std::string(), new_navigation.encoded_page_state());
138 EXPECT_EQ(-1, new_navigation.post_id()); 150 EXPECT_EQ(-1, new_navigation.post_id());
139 EXPECT_EQ(0U, new_navigation.redirect_chain().size()); 151 EXPECT_EQ(0U, new_navigation.redirect_chain().size());
140 } 152 }
141 153
142 // Create a SerializedNavigationEntry, then create a sync protocol buffer from 154 // Create a SerializedNavigationEntry, then create a sync protocol buffer from
143 // it. The protocol buffer should have matching fields to the 155 // it. The protocol buffer should have matching fields to the
144 // SerializedNavigationEntry (when applicable). 156 // SerializedNavigationEntry (when applicable).
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 constructed_nav.transition_type(); 232 constructed_nav.transition_type();
221 233
222 EXPECT_TRUE(ui::PageTransitionTypeIncludingQualifiersIs( 234 EXPECT_TRUE(ui::PageTransitionTypeIncludingQualifiersIs(
223 constructed_transition, transition)); 235 constructed_transition, transition));
224 } 236 }
225 } 237 }
226 } 238 }
227 239
228 } // namespace 240 } // namespace
229 } // namespace sessions 241 } // namespace sessions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698