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

Unified Diff: chrome/browser/sessions/session_restore_browsertest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sessions/session_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore_browsertest.cc
diff --git a/chrome/browser/sessions/session_restore_browsertest.cc b/chrome/browser/sessions/session_restore_browsertest.cc
index a55c778234b5d2ecdce8cc57b15a1430966ab19a..19ae747e8b2071a1c5c930ca1ed0f31ccae12709 100644
--- a/chrome/browser/sessions/session_restore_browsertest.cc
+++ b/chrome/browser/sessions/session_restore_browsertest.cc
@@ -258,9 +258,7 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreIndividualTabFromWindow) {
GURL url1(ui_test_utils::GetTestUrl(
FilePath(FilePath::kCurrentDirectory),
FilePath(FILE_PATH_LITERAL("title1.html"))));
- GURL url2(ui_test_utils::GetTestUrl(
- FilePath(FilePath::kCurrentDirectory),
- FilePath(FILE_PATH_LITERAL("title2.html"))));
+ GURL url2("about:version");
GURL url3(ui_test_utils::GetTestUrl(
FilePath(FilePath::kCurrentDirectory),
FilePath(FILE_PATH_LITERAL("title3.html"))));
@@ -300,17 +298,21 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreIndividualTabFromWindow) {
// Find the SessionID for entry2. Since the session service was destroyed,
// there is no guarantee that the SessionID for the tab has remained the same.
base::Time timestamp;
+ int http_status_code = 0;
for (std::vector<TabRestoreService::Tab>::const_iterator it =
window->tabs.begin(); it != window->tabs.end(); ++it) {
const TabRestoreService::Tab& tab = *it;
// If this tab held url2, then restore this single tab.
if (tab.navigations[0].virtual_url() == url2) {
timestamp = SessionTypesTestHelper::GetTimestamp(tab.navigations[0]);
+ http_status_code =
+ SessionTypesTestHelper::GetHttpStatusCode(tab.navigations[0]);
service->RestoreEntryById(NULL, tab.id, UNKNOWN);
break;
}
}
EXPECT_FALSE(timestamp.is_null());
+ EXPECT_EQ(200, http_status_code);
// Make sure that the restored tab is removed from the service.
ASSERT_EQ(1U, service->entries().size());
@@ -319,7 +321,7 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreIndividualTabFromWindow) {
EXPECT_EQ(2U, window->tabs.size());
// Make sure that the restored tab was restored with the correct
- // timestamp.
+ // timestamp and status code.
const content::WebContents* contents =
chrome::GetActiveWebContents(browser());
ASSERT_TRUE(contents);
@@ -327,6 +329,7 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreIndividualTabFromWindow) {
contents->GetController().GetActiveEntry();
ASSERT_TRUE(entry);
EXPECT_EQ(timestamp, entry->GetTimestamp());
+ EXPECT_EQ(http_status_code, entry->GetHttpStatusCode());
}
IN_PROC_BROWSER_TEST_F(SessionRestoreTest, WindowWithOneTab) {
« no previous file with comments | « no previous file | chrome/browser/sessions/session_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698