| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 std::vector<GURL> redirects; | 125 std::vector<GURL> redirects; |
| 126 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); | 126 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
| 127 ASSERT_TRUE(tab_proxy.get()); | 127 ASSERT_TRUE(tab_proxy.get()); |
| 128 ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); | 128 ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); |
| 129 ASSERT_EQ(1U, redirects.size()); | 129 ASSERT_EQ(1U, redirects.size()); |
| 130 EXPECT_EQ(final_url.spec(), redirects[0].spec()); | 130 EXPECT_EQ(final_url.spec(), redirects[0].spec()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // Tests to make sure a location change when a pending redirect exists isn't | 133 // Tests to make sure a location change when a pending redirect exists isn't |
| 134 // flagged as a redirect. | 134 // flagged as a redirect. |
| 135 #if defined(OS_MACOSX) | 135 #if defined(USE_AURA) |
| 136 // http://crbug.com/104396 |
| 137 #define MAYBE_ClientCancelled FAILS_ClientCancelled |
| 138 #elif defined(OS_MACOSX) |
| 136 // SimulateOSClick is broken on the Mac: http://crbug.com/45162 | 139 // SimulateOSClick is broken on the Mac: http://crbug.com/45162 |
| 137 #define MAYBE_ClientCancelled DISABLED_ClientCancelled | 140 #define MAYBE_ClientCancelled DISABLED_ClientCancelled |
| 138 #elif defined(OS_WIN) | 141 #elif defined(OS_WIN) |
| 139 // http://crbug.com/53091 | 142 // http://crbug.com/53091 |
| 140 #define MAYBE_ClientCancelled FAILS_ClientCancelled | 143 #define MAYBE_ClientCancelled FAILS_ClientCancelled |
| 141 #else | 144 #else |
| 142 #define MAYBE_ClientCancelled ClientCancelled | 145 #define MAYBE_ClientCancelled ClientCancelled |
| 143 #endif | 146 #endif |
| 144 | 147 |
| 145 TEST_F(RedirectTest, MAYBE_ClientCancelled) { | 148 TEST_F(RedirectTest, MAYBE_ClientCancelled) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 it != redirects.end(); ++it) { | 343 it != redirects.end(); ++it) { |
| 341 if (final_url.spec() == it->spec()) { | 344 if (final_url.spec() == it->spec()) { |
| 342 final_navigation_not_redirect = false; | 345 final_navigation_not_redirect = false; |
| 343 break; | 346 break; |
| 344 } | 347 } |
| 345 } | 348 } |
| 346 EXPECT_TRUE(final_navigation_not_redirect); | 349 EXPECT_TRUE(final_navigation_not_redirect); |
| 347 } | 350 } |
| 348 | 351 |
| 349 } // namespace | 352 } // namespace |
| OLD | NEW |