| 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 "base/keyboard_codes.h" | 5 #include "base/keyboard_codes.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/browser_window.h" | 8 #include "chrome/browser/browser_window.h" |
| 9 #include "chrome/browser/find_bar_controller.h" | 9 #include "chrome/browser/find_bar_controller.h" |
| 10 #include "chrome/browser/find_notification_details.h" | 10 #include "chrome/browser/find_notification_details.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 467 |
| 468 // Search for a text that exists within a link on the page. | 468 // Search for a text that exists within a link on the page. |
| 469 int ordinal = 0; | 469 int ordinal = 0; |
| 470 EXPECT_EQ(2, FindInPageWchar(tab_contents, L"html ", | 470 EXPECT_EQ(2, FindInPageWchar(tab_contents, L"html ", |
| 471 kFwd, kIgnoreCase, &ordinal)); | 471 kFwd, kIgnoreCase, &ordinal)); |
| 472 EXPECT_EQ(1, ordinal); | 472 EXPECT_EQ(1, ordinal); |
| 473 } | 473 } |
| 474 | 474 |
| 475 // Make sure Find box disappears on Navigate but not on Refresh. | 475 // Make sure Find box disappears on Navigate but not on Refresh. |
| 476 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) | 476 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) |
| 477 // The last EXPECT_FALSE(fully_visible) is flaky (especially on | 477 // The last EXPECT_FALSE(fully_visible) is failing all the time on |
| 478 // 64bit build.). See bug http://crbug.com/28629. | 478 // the linux_views bot. See bug: http://crbug.com/28629. |
| 479 #define FindDisappearOnNavigate FLAKY_FindDisappearOnNavigate | 479 #define FindDisappearOnNavigate DISABLED_FindDisappearOnNavigate |
| 480 #endif | 480 #endif |
| 481 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { | 481 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { |
| 482 HTTPTestServer* server = StartHTTPServer(); | 482 HTTPTestServer* server = StartHTTPServer(); |
| 483 | 483 |
| 484 // First we navigate to our special focus tracking page. | 484 // First we navigate to our special focus tracking page. |
| 485 GURL url = server->TestServerPageW(kSimplePage); | 485 GURL url = server->TestServerPageW(kSimplePage); |
| 486 GURL url2 = server->TestServerPageW(kFramePage); | 486 GURL url2 = server->TestServerPageW(kFramePage); |
| 487 ui_test_utils::NavigateToURL(browser(), url); | 487 ui_test_utils::NavigateToURL(browser(), url); |
| 488 | 488 |
| 489 // Open the Find window with animations disabled. | 489 // Open the Find window with animations disabled. |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 // Find "given". | 787 // Find "given". |
| 788 FindInPageWchar(tab2, L"given", kFwd, kIgnoreCase, &ordinal); | 788 FindInPageWchar(tab2, L"given", kFwd, kIgnoreCase, &ordinal); |
| 789 | 789 |
| 790 // Switch back to first tab. | 790 // Switch back to first tab. |
| 791 browser()->SelectTabContentsAt(0, false); | 791 browser()->SelectTabContentsAt(0, false); |
| 792 browser()->GetFindBarController()->EndFindSession(); | 792 browser()->GetFindBarController()->EndFindSession(); |
| 793 // Simulate F3. | 793 // Simulate F3. |
| 794 ui_test_utils::FindInPage(tab1, string16(), kFwd, kIgnoreCase, &ordinal); | 794 ui_test_utils::FindInPage(tab1, string16(), kFwd, kIgnoreCase, &ordinal); |
| 795 EXPECT_EQ(tab1->find_text(), WideToUTF16(L"Default")); | 795 EXPECT_EQ(tab1->find_text(), WideToUTF16(L"Default")); |
| 796 } | 796 } |
| OLD | NEW |