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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 206 } |
207 | 207 |
208 // Test timestamps. | 208 // Test timestamps. |
209 TEST_F(NavigationEntryTest, NavigationEntryTimestamps) { | 209 TEST_F(NavigationEntryTest, NavigationEntryTimestamps) { |
210 EXPECT_EQ(base::Time(), entry1_->GetTimestamp()); | 210 EXPECT_EQ(base::Time(), entry1_->GetTimestamp()); |
211 const base::Time now = base::Time::Now(); | 211 const base::Time now = base::Time::Now(); |
212 entry1_->SetTimestamp(now); | 212 entry1_->SetTimestamp(now); |
213 EXPECT_EQ(now, entry1_->GetTimestamp()); | 213 EXPECT_EQ(now, entry1_->GetTimestamp()); |
214 } | 214 } |
215 | 215 |
| 216 // Test extra data stored in the navigation entry. |
| 217 TEST_F(NavigationEntryTest, NavigationEntryExtraData) { |
| 218 string16 test_data = ASCIIToUTF16("my search terms"); |
| 219 string16 output; |
| 220 entry1_->SetExtraData("search_terms", test_data); |
| 221 |
| 222 EXPECT_FALSE(entry1_->GetExtraData("non_existent_key", &output)); |
| 223 EXPECT_EQ(output, ASCIIToUTF16("")); |
| 224 EXPECT_TRUE(entry1_->GetExtraData("search_terms", &output)); |
| 225 EXPECT_EQ(output, test_data); |
| 226 } |
| 227 |
216 } // namespace content | 228 } // namespace content |
OLD | NEW |