| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 9 #include "chrome/browser/find_bar.h" |
| 10 #include "chrome/browser/find_bar_controller.h" | 10 #include "chrome/browser/find_bar_controller.h" |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 // This string appears 5 times at the bottom of a long page. If Find restarts | 502 // This string appears 5 times at the bottom of a long page. If Find restarts |
| 503 // properly after a timeout, it will find 5 matches, not just 1. | 503 // properly after a timeout, it will find 5 matches, not just 1. |
| 504 int ordinal = 0; | 504 int ordinal = 0; |
| 505 EXPECT_EQ(5, FindInPageWchar(browser()->GetSelectedTabContents(), | 505 EXPECT_EQ(5, FindInPageWchar(browser()->GetSelectedTabContents(), |
| 506 L"008.xml", | 506 L"008.xml", |
| 507 kFwd, kIgnoreCase, &ordinal)); | 507 kFwd, kIgnoreCase, &ordinal)); |
| 508 EXPECT_EQ(1, ordinal); | 508 EXPECT_EQ(1, ordinal); |
| 509 } | 509 } |
| 510 | 510 |
| 511 // This tests bug 11761: FindInPage terminates search prematurely. | 511 // This tests bug 11761: FindInPage terminates search prematurely. |
| 512 // This test will be enabled once the bug is fixed. | 512 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FAILS_FindInPagePrematureEnd) { |
| 513 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, | |
| 514 DISABLED_FindInPagePrematureEnd) { | |
| 515 HTTPTestServer* server = StartHTTPServer(); | 513 HTTPTestServer* server = StartHTTPServer(); |
| 516 ASSERT_TRUE(server); | 514 ASSERT_TRUE(server); |
| 517 | 515 |
| 518 // First we navigate to our special focus tracking page. | 516 // First we navigate to our special focus tracking page. |
| 519 GURL url = server->TestServerPage(kPrematureEnd); | 517 GURL url = server->TestServerPage(kPrematureEnd); |
| 520 ui_test_utils::NavigateToURL(browser(), url); | 518 ui_test_utils::NavigateToURL(browser(), url); |
| 521 | 519 |
| 522 TabContents* tab_contents = browser()->GetSelectedTabContents(); | 520 TabContents* tab_contents = browser()->GetSelectedTabContents(); |
| 523 ASSERT_TRUE(NULL != tab_contents); | 521 ASSERT_TRUE(NULL != tab_contents); |
| 524 | 522 |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 | 1083 |
| 1086 TabContents* tab = browser()->GetSelectedTabContents(); | 1084 TabContents* tab = browser()->GetSelectedTabContents(); |
| 1087 int ordinal = 0; | 1085 int ordinal = 0; |
| 1088 FindInPageWchar(tab, L"link", kFwd, kIgnoreCase, &ordinal); | 1086 FindInPageWchar(tab, L"link", kFwd, kIgnoreCase, &ordinal); |
| 1089 EXPECT_EQ(ordinal, 1); | 1087 EXPECT_EQ(ordinal, 1); |
| 1090 | 1088 |
| 1091 // End the find session, click on the link. | 1089 // End the find session, click on the link. |
| 1092 tab->StopFinding(FindBarController::kActivateSelection); | 1090 tab->StopFinding(FindBarController::kActivateSelection); |
| 1093 EXPECT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); | 1091 EXPECT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); |
| 1094 } | 1092 } |
| OLD | NEW |