OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/string16.h" | 5 #include "base/string16.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/browser/site_instance_impl.h" | 9 #include "content/browser/site_instance_impl.h" |
10 #include "content/browser/web_contents/navigation_entry_impl.h" | 10 #include "content/browser/web_contents/navigation_entry_impl.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 Referrer(GURL("from2"), WebKit::WebReferrerPolicyDefault)); | 135 Referrer(GURL("from2"), WebKit::WebReferrerPolicyDefault)); |
136 EXPECT_EQ(GURL("from2"), entry2_->GetReferrer().url); | 136 EXPECT_EQ(GURL("from2"), entry2_->GetReferrer().url); |
137 | 137 |
138 // Title | 138 // Title |
139 EXPECT_EQ(string16(), entry1_->GetTitle()); | 139 EXPECT_EQ(string16(), entry1_->GetTitle()); |
140 EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitle()); | 140 EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitle()); |
141 entry2_->SetTitle(ASCIIToUTF16("title2")); | 141 entry2_->SetTitle(ASCIIToUTF16("title2")); |
142 EXPECT_EQ(ASCIIToUTF16("title2"), entry2_->GetTitle()); | 142 EXPECT_EQ(ASCIIToUTF16("title2"), entry2_->GetTitle()); |
143 | 143 |
144 // State | 144 // State |
145 EXPECT_EQ(std::string(), entry1_->GetContentState()); | 145 EXPECT_FALSE(entry1_->GetPageState().IsValid()); |
146 EXPECT_EQ(std::string(), entry2_->GetContentState()); | 146 EXPECT_FALSE(entry2_->GetPageState().IsValid()); |
147 entry2_->SetContentState("state"); | 147 entry2_->SetPageState(PageState::CreateFromEncodedData("state")); |
148 EXPECT_EQ("state", entry2_->GetContentState()); | 148 EXPECT_EQ("state", entry2_->GetPageState().ToEncodedData()); |
149 | 149 |
150 // Page ID | 150 // Page ID |
151 EXPECT_EQ(-1, entry1_->GetPageID()); | 151 EXPECT_EQ(-1, entry1_->GetPageID()); |
152 EXPECT_EQ(3, entry2_->GetPageID()); | 152 EXPECT_EQ(3, entry2_->GetPageID()); |
153 entry2_->SetPageID(2); | 153 entry2_->SetPageID(2); |
154 EXPECT_EQ(2, entry2_->GetPageID()); | 154 EXPECT_EQ(2, entry2_->GetPageID()); |
155 | 155 |
156 // Transition type | 156 // Transition type |
157 EXPECT_EQ(PAGE_TRANSITION_LINK, entry1_->GetTransitionType()); | 157 EXPECT_EQ(PAGE_TRANSITION_LINK, entry1_->GetTransitionType()); |
158 EXPECT_EQ(PAGE_TRANSITION_TYPED, entry2_->GetTransitionType()); | 158 EXPECT_EQ(PAGE_TRANSITION_TYPED, entry2_->GetTransitionType()); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // Content in |output| is not modified if data is not present at the key. | 232 // Content in |output| is not modified if data is not present at the key. |
233 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output)); | 233 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output)); |
234 EXPECT_EQ(test_data, output); | 234 EXPECT_EQ(test_data, output); |
235 // Using an empty string shows that the data is not present in the map. | 235 // Using an empty string shows that the data is not present in the map. |
236 string16 output2; | 236 string16 output2; |
237 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output2)); | 237 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output2)); |
238 EXPECT_EQ(ASCIIToUTF16(""), output2); | 238 EXPECT_EQ(ASCIIToUTF16(""), output2); |
239 } | 239 } |
240 | 240 |
241 } // namespace content | 241 } // namespace content |
OLD | NEW |