| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/app/chrome_dll_resource.h" | 5 #include "chrome/app/chrome_dll_resource.h" |
| 6 #include "chrome/test/automation/browser_proxy.h" | 6 #include "chrome/test/automation/browser_proxy.h" |
| 7 #include "chrome/test/automation/tab_proxy.h" | 7 #include "chrome/test/automation/tab_proxy.h" |
| 8 #include "chrome/test/ui/ui_test.h" | 8 #include "chrome/test/ui/ui_test.h" |
| 9 #include "net/url_request/url_request_unittest.h" | 9 #include "net/url_request/url_request_unittest.h" |
| 10 | 10 |
| 11 class FindInPageControllerTest : public UITest { | 11 class FindInPageControllerTest : public UITest { |
| 12 public: | 12 public: |
| 13 FindInPageControllerTest() { | 13 FindInPageControllerTest() { |
| 14 show_window_ = true; | 14 show_window_ = true; |
| 15 } | 15 } |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 const std::string kSimplePage = "404_is_enough_for_us.html"; | 18 const std::string kSimplePage = "404_is_enough_for_us.html"; |
| 19 | 19 |
| 20 #if !defined(OS_WIN) | 20 #if !defined(OS_WIN) |
| 21 // Has never been enabled on other platforms http://crbug.com/45753 | 21 // Has never been enabled on other platforms http://crbug.com/45753 |
| 22 #define FindMovesOnTabClose_Issue1343052 \ | 22 #define FindMovesOnTabClose_Issue1343052 \ |
| 23 DISABLED_FindMovesOnTabClose_Issue1343052 | 23 DISABLED_FindMovesOnTabClose_Issue1343052 |
| 24 #endif | 24 #endif |
| 25 // The find window should not change its location just because we open and close | 25 // The find window should not change its location just because we open and close |
| 26 // a new tab. | 26 // a new tab. |
| 27 TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { | 27 TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { |
| 28 scoped_refptr<HTTPTestServer> server = | 28 scoped_refptr<HTTPTestServer> server = |
| 29 HTTPTestServer::CreateServer(L"chrome/test/data", NULL); | 29 HTTPTestServer::CreateServer(L"chrome/test/data"); |
| 30 ASSERT_TRUE(NULL != server.get()); | 30 ASSERT_TRUE(NULL != server.get()); |
| 31 | 31 |
| 32 GURL url = server->TestServerPage(kSimplePage); | 32 GURL url = server->TestServerPage(kSimplePage); |
| 33 scoped_refptr<TabProxy> tabA(GetActiveTab()); | 33 scoped_refptr<TabProxy> tabA(GetActiveTab()); |
| 34 ASSERT_TRUE(tabA.get()); | 34 ASSERT_TRUE(tabA.get()); |
| 35 ASSERT_TRUE(tabA->NavigateToURL(url)); | 35 ASSERT_TRUE(tabA->NavigateToURL(url)); |
| 36 WaitUntilTabCount(1); | 36 WaitUntilTabCount(1); |
| 37 | 37 |
| 38 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 38 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 39 ASSERT_TRUE(browser.get() != NULL); | 39 ASSERT_TRUE(browser.get() != NULL); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 // Close it. | 80 // Close it. |
| 81 EXPECT_TRUE(tabC->Close(true)); | 81 EXPECT_TRUE(tabC->Close(true)); |
| 82 | 82 |
| 83 // See if the Find window has moved. | 83 // See if the Find window has moved. |
| 84 EXPECT_TRUE(browser->GetFindWindowLocation(&new_x, &new_y)); | 84 EXPECT_TRUE(browser->GetFindWindowLocation(&new_x, &new_y)); |
| 85 | 85 |
| 86 EXPECT_EQ(x, new_x); | 86 EXPECT_EQ(x, new_x); |
| 87 EXPECT_EQ(y, new_y); | 87 EXPECT_EQ(y, new_y); |
| 88 } | 88 } |
| OLD | NEW |