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

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

Issue 12052023: Add "frame to navigate" to NavigationEntry and plumb it to the RenderViewImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 7 years, 11 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 | Annotate | Revision Log
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 EXPECT_EQ(NULL, entry2_->GetBrowserInitiatedPostData()); 196 EXPECT_EQ(NULL, entry2_->GetBrowserInitiatedPostData());
197 const int length = 11; 197 const int length = 11;
198 const unsigned char* raw_data = 198 const unsigned char* raw_data =
199 reinterpret_cast<const unsigned char*>("post\n\n\0data"); 199 reinterpret_cast<const unsigned char*>("post\n\n\0data");
200 std::vector<unsigned char> post_data_vector(raw_data, raw_data+length); 200 std::vector<unsigned char> post_data_vector(raw_data, raw_data+length);
201 scoped_refptr<base::RefCountedBytes> post_data = 201 scoped_refptr<base::RefCountedBytes> post_data =
202 base::RefCountedBytes::TakeVector(&post_data_vector); 202 base::RefCountedBytes::TakeVector(&post_data_vector);
203 entry2_->SetBrowserInitiatedPostData(post_data.get()); 203 entry2_->SetBrowserInitiatedPostData(post_data.get());
204 EXPECT_EQ(post_data->front(), 204 EXPECT_EQ(post_data->front(),
205 entry2_->GetBrowserInitiatedPostData()->front()); 205 entry2_->GetBrowserInitiatedPostData()->front());
206
207 // Frame to navigate.
208 EXPECT_TRUE(entry1_->GetFrameToNavigate().empty());
209 EXPECT_TRUE(entry2_->GetFrameToNavigate().empty());
206 } 210 }
207 211
208 // Test timestamps. 212 // Test timestamps.
209 TEST_F(NavigationEntryTest, NavigationEntryTimestamps) { 213 TEST_F(NavigationEntryTest, NavigationEntryTimestamps) {
210 EXPECT_EQ(base::Time(), entry1_->GetTimestamp()); 214 EXPECT_EQ(base::Time(), entry1_->GetTimestamp());
211 const base::Time now = base::Time::Now(); 215 const base::Time now = base::Time::Now();
212 entry1_->SetTimestamp(now); 216 entry1_->SetTimestamp(now);
213 EXPECT_EQ(now, entry1_->GetTimestamp()); 217 EXPECT_EQ(now, entry1_->GetTimestamp());
214 } 218 }
215 219
216 } // namespace content 220 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/navigation_entry_impl.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698