Index: chrome/browser/history/redirect_uitest.cc |
=================================================================== |
--- chrome/browser/history/redirect_uitest.cc (revision 56849) |
+++ chrome/browser/history/redirect_uitest.cc (working copy) |
@@ -13,14 +13,10 @@ |
#include "base/string_util.h" |
#include "base/string16.h" |
#include "base/utf_string_conversions.h" |
-#include "chrome/browser/view_ids.h" |
-#include "chrome/test/automation/browser_proxy.h" |
#include "chrome/test/automation/tab_proxy.h" |
-#include "chrome/test/automation/window_proxy.h" |
#include "chrome/test/ui/ui_test.h" |
#include "net/base/net_util.h" |
#include "net/test/test_server.h" |
-#include "views/event.h" |
namespace { |
@@ -109,8 +105,6 @@ |
// Tests to make sure a location change when a pending redirect exists isn't |
// flagged as a redirect. |
-#if defined(OS_WIN) || defined(OS_LINUX) |
-// SimulateOSClick is broken on the Mac: http://crbug.com/45162 |
TEST_F(RedirectTest, ClientCancelled) { |
FilePath first_path(test_data_directory_); |
first_path = first_path.AppendASCII("cancelled_redirect_test.html"); |
@@ -119,26 +113,10 @@ |
NavigateToURLBlockUntilNavigationsComplete(first_url, 1); |
- scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0); |
- ASSERT_TRUE(browser.get()); |
- scoped_refptr<WindowProxy> window = browser->GetWindow(); |
- ASSERT_TRUE(window.get()); |
+ NavigateToURL(GURL("javascript:click()")); // User initiated location change. |
+ |
scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
ASSERT_TRUE(tab_proxy.get()); |
- int64 last_nav_time = 0; |
- EXPECT_TRUE(tab_proxy->GetLastNavigationTime(&last_nav_time)); |
- // Simulate a click to force to make a user-initiated location change; |
- // otherwise, a non user-initiated in-page location change will be treated |
- // as client redirect and the redirect will be recoreded, which can cause |
- // this test failed. |
- gfx::Rect tab_view_bounds; |
- ASSERT_TRUE(browser->BringToFront()); |
- ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER, &tab_view_bounds, |
- true)); |
- ASSERT_TRUE( |
- window->SimulateOSClick(tab_view_bounds.CenterPoint(), |
- views::Event::EF_LEFT_BUTTON_DOWN)); |
- EXPECT_TRUE(tab_proxy->WaitForNavigation(last_nav_time)); |
std::vector<GURL> redirects; |
ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects)); |
@@ -162,7 +140,6 @@ |
StringToLowerASCII(current_path.value())); |
EXPECT_EQ(final_ref, current_url.ref()); |
} |
-#endif |
// Tests a client->server->server redirect |
TEST_F(RedirectTest, ClientServerServer) { |