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/memory/scoped_vector.h" | 5 #include "base/memory/scoped_vector.h" |
6 #include "chrome/browser/history/history_types.h" | 6 #include "chrome/browser/history/history_types.h" |
7 #include "chrome/browser/sessions/session_service.h" | 7 #include "chrome/browser/sessions/session_service.h" |
8 #include "chrome/browser/sessions/session_types.h" | 8 #include "chrome/browser/sessions/session_types.h" |
9 #include "chrome/browser/sync/profile_sync_service_harness.h" | 9 #include "chrome/browser/sync/profile_sync_service_harness.h" |
10 #include "chrome/browser/sync/test/integration/sessions_helper.h" | 10 #include "chrome/browser/sync/test/integration/sessions_helper.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 ASSERT_TRUE(GetUrlFromClient(0, it3->virtual_url(), &virtual_row)); | 88 ASSERT_TRUE(GetUrlFromClient(0, it3->virtual_url(), &virtual_row)); |
89 const base::Time history_timestamp = virtual_row.last_visit(); | 89 const base::Time history_timestamp = virtual_row.last_visit(); |
90 | 90 |
91 ASSERT_EQ(timestamp, history_timestamp); | 91 ASSERT_EQ(timestamp, history_timestamp); |
92 ++found_navigations; | 92 ++found_navigations; |
93 } | 93 } |
94 } | 94 } |
95 } | 95 } |
96 ASSERT_EQ(1, found_navigations); | 96 ASSERT_EQ(1, found_navigations); |
97 } | 97 } |
| 98 |
| 99 IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, ResponseCodeIsPreserved) { |
| 100 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 101 |
| 102 ASSERT_TRUE(CheckInitialState(0)); |
| 103 |
| 104 // We want a URL that doesn't 404 and has a non-empty title. |
| 105 // about:version is simple to render, too. |
| 106 const GURL url("about:version"); |
| 107 |
| 108 ScopedWindowMap windows; |
| 109 ASSERT_TRUE(OpenTabAndGetLocalWindows(0, url, windows.GetMutable())); |
| 110 |
| 111 int found_navigations = 0; |
| 112 for (SessionWindowMap::const_iterator it = windows.Get()->begin(); |
| 113 it != windows.Get()->end(); ++it) { |
| 114 for (std::vector<SessionTab*>::const_iterator it2 = |
| 115 it->second->tabs.begin(); it2 != it->second->tabs.end(); ++it2) { |
| 116 for (std::vector<sessions::SerializedNavigationEntry>::const_iterator |
| 117 it3 = (*it2)->navigations.begin(); |
| 118 it3 != (*it2)->navigations.end(); ++it3) { |
| 119 EXPECT_EQ(200, it3->http_status_code()); |
| 120 ++found_navigations; |
| 121 } |
| 122 } |
| 123 } |
| 124 ASSERT_EQ(1, found_navigations); |
| 125 } |
OLD | NEW |