OLD | NEW |
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 Loading... |
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, |
| 137 new_navigation.extended_info_map().count(test_data::kExtendedInfoKey1)); |
| 138 EXPECT_EQ(test_data::kExtendedInfoValue1, |
| 139 new_navigation.extended_info_map().at(test_data::kExtendedInfoKey1)); |
| 140 ASSERT_EQ(1U, |
| 141 new_navigation.extended_info_map().count(test_data::kExtendedInfoKey2)); |
| 142 EXPECT_EQ(test_data::kExtendedInfoValue2, |
| 143 new_navigation.extended_info_map().at(test_data::kExtendedInfoKey2)); |
| 144 |
135 // Fields that are not written to the pickle. | 145 // Fields that are not written to the pickle. |
136 EXPECT_EQ(0, new_navigation.unique_id()); | 146 EXPECT_EQ(0, new_navigation.unique_id()); |
137 EXPECT_EQ(std::string(), new_navigation.encoded_page_state()); | 147 EXPECT_EQ(std::string(), new_navigation.encoded_page_state()); |
138 EXPECT_EQ(-1, new_navigation.post_id()); | 148 EXPECT_EQ(-1, new_navigation.post_id()); |
139 EXPECT_EQ(0U, new_navigation.redirect_chain().size()); | 149 EXPECT_EQ(0U, new_navigation.redirect_chain().size()); |
140 } | 150 } |
141 | 151 |
142 // Create a SerializedNavigationEntry, then create a sync protocol buffer from | 152 // Create a SerializedNavigationEntry, then create a sync protocol buffer from |
143 // it. The protocol buffer should have matching fields to the | 153 // it. The protocol buffer should have matching fields to the |
144 // SerializedNavigationEntry (when applicable). | 154 // SerializedNavigationEntry (when applicable). |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 constructed_nav.transition_type(); | 230 constructed_nav.transition_type(); |
221 | 231 |
222 EXPECT_TRUE(ui::PageTransitionTypeIncludingQualifiersIs( | 232 EXPECT_TRUE(ui::PageTransitionTypeIncludingQualifiersIs( |
223 constructed_transition, transition)); | 233 constructed_transition, transition)); |
224 } | 234 } |
225 } | 235 } |
226 } | 236 } |
227 | 237 |
228 } // namespace | 238 } // namespace |
229 } // namespace sessions | 239 } // namespace sessions |
OLD | NEW |