| 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 // Navigates the browser to server and client redirect pages and makes sure | 5 // Navigates the browser to server and client redirect pages and makes sure |
| 6 // that the correct redirects are reflected in the history database. Errors | 6 // that the correct redirects are reflected in the history database. Errors |
| 7 // here might indicate that WebKit changed the calls our glue layer gets in | 7 // here might indicate that WebKit changed the calls our glue layer gets in |
| 8 // the case of redirects. It may also mean problems with the history system. | 8 // the case of redirects. It may also mean problems with the history system. |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 std::vector<GURL> redirects; | 99 std::vector<GURL> redirects; |
| 100 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); | 100 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
| 101 ASSERT_TRUE(tab_proxy.get()); | 101 ASSERT_TRUE(tab_proxy.get()); |
| 102 ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); | 102 ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); |
| 103 ASSERT_EQ(1U, redirects.size()); | 103 ASSERT_EQ(1U, redirects.size()); |
| 104 EXPECT_EQ(final_url.spec(), redirects[0].spec()); | 104 EXPECT_EQ(final_url.spec(), redirects[0].spec()); |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Tests to make sure a location change when a pending redirect exists isn't | 107 // Tests to make sure a location change when a pending redirect exists isn't |
| 108 // flagged as a redirect. | 108 // flagged as a redirect. |
| 109 TEST_F(RedirectTest, ClientCancelled) { | 109 TEST_F(RedirectTest, DISABLED_ClientCancelled) { |
| 110 FilePath first_path(test_data_directory_); | 110 FilePath first_path(test_data_directory_); |
| 111 first_path = first_path.AppendASCII("cancelled_redirect_test.html"); | 111 first_path = first_path.AppendASCII("cancelled_redirect_test.html"); |
| 112 ASSERT_TRUE(file_util::AbsolutePath(&first_path)); | 112 ASSERT_TRUE(file_util::AbsolutePath(&first_path)); |
| 113 GURL first_url = net::FilePathToFileURL(first_path); | 113 GURL first_url = net::FilePathToFileURL(first_path); |
| 114 | 114 |
| 115 // The client redirect appears as two page visits in the browser. | 115 // The client redirect appears as two page visits in the browser. |
| 116 NavigateToURLBlockUntilNavigationsComplete(first_url, 2); | 116 NavigateToURLBlockUntilNavigationsComplete(first_url, 2); |
| 117 | 117 |
| 118 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); | 118 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
| 119 ASSERT_TRUE(tab_proxy.get()); | 119 ASSERT_TRUE(tab_proxy.get()); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 it != redirects.end(); ++it) { | 298 it != redirects.end(); ++it) { |
| 299 if (final_url.spec() == it->spec()) { | 299 if (final_url.spec() == it->spec()) { |
| 300 final_navigation_not_redirect = false; | 300 final_navigation_not_redirect = false; |
| 301 break; | 301 break; |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 EXPECT_TRUE(final_navigation_not_redirect); | 304 EXPECT_TRUE(final_navigation_not_redirect); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace | 307 } // namespace |
| OLD | NEW |