OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 ASSERT_TRUE(GetActiveTabURL() == url2); | 138 ASSERT_TRUE(GetActiveTabURL() == url2); |
139 ASSERT_TRUE(tab_proxy->GoBack()); | 139 ASSERT_TRUE(tab_proxy->GoBack()); |
140 ASSERT_TRUE(GetActiveTabURL() == url1); | 140 ASSERT_TRUE(GetActiveTabURL() == url1); |
141 } | 141 } |
142 | 142 |
143 // Tests that the SiteInstances used for entries in a restored tab's history | 143 // Tests that the SiteInstances used for entries in a restored tab's history |
144 // are given appropriate max page IDs, so that going back to a restored | 144 // are given appropriate max page IDs, so that going back to a restored |
145 // cross-site page and then forward again works. (Bug 1204135) | 145 // cross-site page and then forward again works. (Bug 1204135) |
146 TEST_F(SessionRestoreUITest, RestoresCrossSiteForwardAndBackwardNavs) { | 146 TEST_F(SessionRestoreUITest, RestoresCrossSiteForwardAndBackwardNavs) { |
147 const wchar_t kDocRoot[] = L"chrome/test/data"; | 147 const wchar_t kDocRoot[] = L"chrome/test/data"; |
148 scoped_refptr<HTTPTestServer> server = | 148 TestServer server(kDocRoot); |
149 HTTPTestServer::CreateServer(kDocRoot); | 149 GURL cross_site_url(server.TestServerPageW(L"files/title2.html")); |
150 ASSERT_TRUE(NULL != server.get()); | |
151 GURL cross_site_url(server->TestServerPageW(L"files/title2.html")); | |
152 | 150 |
153 // Visit URLs on different sites. | 151 // Visit URLs on different sites. |
154 NavigateToURL(url1); | 152 NavigateToURL(url1); |
155 NavigateToURL(cross_site_url); | 153 NavigateToURL(cross_site_url); |
156 NavigateToURL(url2); | 154 NavigateToURL(url2); |
157 | 155 |
158 ASSERT_TRUE(GetActiveTab()->GoBack()); | 156 ASSERT_TRUE(GetActiveTab()->GoBack()); |
159 | 157 |
160 QuitBrowserAndRestore(); | 158 QuitBrowserAndRestore(); |
161 | 159 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(restored_tab_count - 2)); | 422 scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(restored_tab_count - 2)); |
425 ASSERT_TRUE(tab_proxy.get() != NULL); | 423 ASSERT_TRUE(tab_proxy.get() != NULL); |
426 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); | 424 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); |
427 tab_proxy.reset(browser_proxy->GetTab(restored_tab_count - 1)); | 425 tab_proxy.reset(browser_proxy->GetTab(restored_tab_count - 1)); |
428 ASSERT_TRUE(tab_proxy.get() != NULL); | 426 ASSERT_TRUE(tab_proxy.get() != NULL); |
429 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); | 427 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); |
430 | 428 |
431 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); | 429 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); |
432 } | 430 } |
433 | 431 |
OLD | NEW |