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

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

Issue 11054025: [Sync] Add HTTP status codes to NavigationEntry and TabNavigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto 11096037 Created 8 years, 2 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 EXPECT_EQ(controller.GetLastCommittedEntryIndex(), -1); 257 EXPECT_EQ(controller.GetLastCommittedEntryIndex(), -1);
258 EXPECT_EQ(controller.GetPendingEntryIndex(), -1); 258 EXPECT_EQ(controller.GetPendingEntryIndex(), -1);
259 EXPECT_FALSE(controller.GetLastCommittedEntry()); 259 EXPECT_FALSE(controller.GetLastCommittedEntry());
260 ASSERT_TRUE(controller.GetPendingEntry()); 260 ASSERT_TRUE(controller.GetPendingEntry());
261 EXPECT_EQ(controller.GetPendingEntry(), controller.GetActiveEntry()); 261 EXPECT_EQ(controller.GetPendingEntry(), controller.GetActiveEntry());
262 EXPECT_EQ(controller.GetPendingEntry(), controller.GetVisibleEntry()); 262 EXPECT_EQ(controller.GetPendingEntry(), controller.GetVisibleEntry());
263 EXPECT_FALSE(controller.CanGoBack()); 263 EXPECT_FALSE(controller.CanGoBack());
264 EXPECT_FALSE(controller.CanGoForward()); 264 EXPECT_FALSE(controller.CanGoForward());
265 EXPECT_EQ(contents()->GetMaxPageID(), -1); 265 EXPECT_EQ(contents()->GetMaxPageID(), -1);
266 266
267 // The timestamp should not have been set yet. 267 // Neither the timestamp nor the status code should have been set
268 // yet.
268 EXPECT_TRUE(controller.GetPendingEntry()->GetTimestamp().is_null()); 269 EXPECT_TRUE(controller.GetPendingEntry()->GetTimestamp().is_null());
270 EXPECT_EQ(0, controller.GetPendingEntry()->GetHttpStatusCode());
269 271
270 // We should have gotten no notifications from the preceeding checks. 272 // We should have gotten no notifications from the preceeding checks.
271 EXPECT_EQ(0U, notifications.size()); 273 EXPECT_EQ(0U, notifications.size());
272 274
273 test_rvh()->SendNavigate(0, url1); 275 test_rvh()->SendNavigate(0, url1);
274 EXPECT_TRUE(notifications.Check1AndReset( 276 EXPECT_TRUE(notifications.Check1AndReset(
275 content::NOTIFICATION_NAV_ENTRY_COMMITTED)); 277 content::NOTIFICATION_NAV_ENTRY_COMMITTED));
276 278
277 // The load should now be committed. 279 // The load should now be committed.
278 EXPECT_EQ(controller.GetEntryCount(), 1); 280 EXPECT_EQ(controller.GetEntryCount(), 1);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 EXPECT_EQ(controller.GetPendingEntryIndex(), -1); 324 EXPECT_EQ(controller.GetPendingEntryIndex(), -1);
323 EXPECT_TRUE(controller.GetLastCommittedEntry()); 325 EXPECT_TRUE(controller.GetLastCommittedEntry());
324 EXPECT_FALSE(controller.GetPendingEntry()); 326 EXPECT_FALSE(controller.GetPendingEntry());
325 ASSERT_TRUE(controller.GetActiveEntry()); 327 ASSERT_TRUE(controller.GetActiveEntry());
326 EXPECT_EQ(controller.GetActiveEntry(), controller.GetVisibleEntry()); 328 EXPECT_EQ(controller.GetActiveEntry(), controller.GetVisibleEntry());
327 EXPECT_TRUE(controller.CanGoBack()); 329 EXPECT_TRUE(controller.CanGoBack());
328 EXPECT_FALSE(controller.CanGoForward()); 330 EXPECT_FALSE(controller.CanGoForward());
329 EXPECT_EQ(contents()->GetMaxPageID(), 1); 331 EXPECT_EQ(contents()->GetMaxPageID(), 1);
330 332
331 EXPECT_FALSE(controller.GetActiveEntry()->GetTimestamp().is_null()); 333 EXPECT_FALSE(controller.GetActiveEntry()->GetTimestamp().is_null());
334 EXPECT_EQ(200, controller.GetActiveEntry()->GetHttpStatusCode());
332 } 335 }
333 336
334 namespace { 337 namespace {
335 338
336 base::Time GetFixedTime(base::Time time) { 339 base::Time GetFixedTime(base::Time time) {
337 return time; 340 return time;
338 } 341 }
339 342
340 } // namespace 343 } // namespace
341 344
(...skipping 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after
3159 TabNavigation nav(0, url0, GURL(), string16(), 3162 TabNavigation nav(0, url0, GURL(), string16(),
3160 webkit_glue::CreateHistoryStateForURL(url0), 3163 webkit_glue::CreateHistoryStateForURL(url0),
3161 content::PAGE_TRANSITION_LINK); 3164 content::PAGE_TRANSITION_LINK);
3162 session_helper_.AssertNavigationEquals(nav, 3165 session_helper_.AssertNavigationEquals(nav,
3163 windows_[0]->tabs[0]->navigations[0]); 3166 windows_[0]->tabs[0]->navigations[0]);
3164 nav.set_url(url2); 3167 nav.set_url(url2);
3165 session_helper_.AssertNavigationEquals(nav, 3168 session_helper_.AssertNavigationEquals(nav,
3166 windows_[0]->tabs[0]->navigations[1]); 3169 windows_[0]->tabs[0]->navigations[1]);
3167 } 3170 }
3168 */ 3171 */
OLDNEW
« no previous file with comments | « content/browser/web_contents/navigation_controller_impl.cc ('k') | content/browser/web_contents/navigation_entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698