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