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

Unified Diff: chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc

Issue 11054025: [Sync] Add HTTP status codes to NavigationEntry and TabNavigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
index f54876bf66e9132622cf9e7589bf7c7a1d5a5d77..3e23a95c4e2fb1a25b97ae46bc0a75c58dee52c8 100644
--- a/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sessions/session_types.h"
+#include "chrome/browser/sessions/session_types_test_helper.h"
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/browser/sync/test/integration/sessions_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
@@ -82,7 +83,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, TimestampMatchesHistory) {
for (std::vector<TabNavigation>::const_iterator it3 =
(*it2)->navigations.begin();
it3 != (*it2)->navigations.end(); ++it3) {
- const base::Time timestamp = it3->timestamp();
+ const base::Time timestamp = SessionTypesTestHelper::GetTimestamp(*it3);
history::URLRow virtual_row;
ASSERT_TRUE(GetUrlFromClient(0, it3->virtual_url(), &virtual_row));
@@ -95,3 +96,31 @@ IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, TimestampMatchesHistory) {
}
ASSERT_EQ(1, found_navigations);
}
+
+IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, ResponseCodeIsPreserved) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ ASSERT_TRUE(CheckInitialState(0));
+
+ // We want a URL that doesn't 404 and has a non-empty title.
+ // about:version is simple to render, too.
+ const GURL url("about:version");
+
+ ScopedWindowMap windows;
+ ASSERT_TRUE(OpenTabAndGetLocalWindows(0, url, windows.GetMutable()));
+
+ int found_navigations = 0;
+ for (SessionWindowMap::const_iterator it = windows.Get()->begin();
+ it != windows.Get()->end(); ++it) {
+ for (std::vector<SessionTab*>::const_iterator it2 =
+ it->second->tabs.begin(); it2 != it->second->tabs.end(); ++it2) {
+ for (std::vector<TabNavigation>::const_iterator it3 =
+ (*it2)->navigations.begin();
+ it3 != (*it2)->navigations.end(); ++it3) {
+ EXPECT_EQ(200, SessionTypesTestHelper::GetHttpStatusCode(*it3));
Nicolas Zea 2012/10/04 18:41:31 verify this navigation is for the proper url as we
+ ++found_navigations;
+ }
+ }
+ }
+ ASSERT_EQ(1, found_navigations);
+}

Powered by Google App Engine
This is Rietveld 408576698