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/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 Loading... |
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 Loading... |
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 Loading... |
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 */ |
OLD | NEW |