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

Side by Side Diff: content/browser/web_contents/navigation_entry_impl_unittest.cc

Issue 11415292: [Search] No longer reverting omnibox text on instant search (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: More tests Created 8 years 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) 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 entry2_->SetReferrer( 134 entry2_->SetReferrer(
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 // Search terms
145 EXPECT_EQ(string16(), entry1_->GetSearchTerms());
146 entry1_->SetSearchTerms(ASCIIToUTF16("hello world"));
147 EXPECT_EQ(ASCIIToUTF16("hello world"), entry1_->GetSearchTerms());
148
144 // State 149 // State
145 EXPECT_EQ(std::string(), entry1_->GetContentState()); 150 EXPECT_EQ(std::string(), entry1_->GetContentState());
146 EXPECT_EQ(std::string(), entry2_->GetContentState()); 151 EXPECT_EQ(std::string(), entry2_->GetContentState());
147 entry2_->SetContentState("state"); 152 entry2_->SetContentState("state");
148 EXPECT_EQ("state", entry2_->GetContentState()); 153 EXPECT_EQ("state", entry2_->GetContentState());
149 154
150 // Page ID 155 // Page ID
151 EXPECT_EQ(-1, entry1_->GetPageID()); 156 EXPECT_EQ(-1, entry1_->GetPageID());
152 EXPECT_EQ(3, entry2_->GetPageID()); 157 EXPECT_EQ(3, entry2_->GetPageID());
153 entry2_->SetPageID(2); 158 entry2_->SetPageID(2);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 212
208 // Test timestamps. 213 // Test timestamps.
209 TEST_F(NavigationEntryTest, NavigationEntryTimestamps) { 214 TEST_F(NavigationEntryTest, NavigationEntryTimestamps) {
210 EXPECT_EQ(base::Time(), entry1_->GetTimestamp()); 215 EXPECT_EQ(base::Time(), entry1_->GetTimestamp());
211 const base::Time now = base::Time::Now(); 216 const base::Time now = base::Time::Now();
212 entry1_->SetTimestamp(now); 217 entry1_->SetTimestamp(now);
213 EXPECT_EQ(now, entry1_->GetTimestamp()); 218 EXPECT_EQ(now, entry1_->GetTimestamp());
214 } 219 }
215 220
216 } // namespace content 221 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698