| 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 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 browser()->SelectTabContentsAt(1, false); | 1070 browser()->SelectTabContentsAt(1, false); |
| 1071 TabContents* tab2 = browser()->GetSelectedTabContents(); | 1071 TabContents* tab2 = browser()->GetSelectedTabContents(); |
| 1072 EXPECT_NE(tab1, tab2); | 1072 EXPECT_NE(tab1, tab2); |
| 1073 | 1073 |
| 1074 // Open the Find box and make sure it is prepopulated with the search term | 1074 // Open the Find box and make sure it is prepopulated with the search term |
| 1075 // from the original browser, not the search term from the incognito window. | 1075 // from the original browser, not the search term from the incognito window. |
| 1076 EnsureFindBoxOpenForBrowser(browser()); | 1076 EnsureFindBoxOpenForBrowser(browser()); |
| 1077 EXPECT_EQ(ASCIIToUTF16("page"), GetFindBarTextForBrowser(browser())); | 1077 EXPECT_EQ(ASCIIToUTF16("page"), GetFindBarTextForBrowser(browser())); |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 // See http://crbug.com/45594. On Windows, it crashes sometimes. |
| 1081 #if defined(OS_WIN) |
| 1082 #define MAYBE_ActivateLinkNavigatesPage DISABLED_ActivateLinkNavigatesPage |
| 1083 #else |
| 1084 #define MAYBE_ActivateLinkNavigatesPage ActivateLinkNavigatesPage |
| 1085 #endif |
| 1080 // This makes sure that dismissing the find bar with kActivateSelection works. | 1086 // This makes sure that dismissing the find bar with kActivateSelection works. |
| 1081 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, ActivateLinkNavigatesPage) { | 1087 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, |
| 1088 MAYBE_ActivateLinkNavigatesPage) { |
| 1082 HTTPTestServer* server = StartHTTPServer(); | 1089 HTTPTestServer* server = StartHTTPServer(); |
| 1083 ASSERT_TRUE(server); | 1090 ASSERT_TRUE(server); |
| 1084 | 1091 |
| 1085 // First we navigate to our test content. | 1092 // First we navigate to our test content. |
| 1086 GURL url = server->TestServerPage(kLinkPage); | 1093 GURL url = server->TestServerPage(kLinkPage); |
| 1087 ui_test_utils::NavigateToURL(browser(), url); | 1094 ui_test_utils::NavigateToURL(browser(), url); |
| 1088 | 1095 |
| 1089 TabContents* tab = browser()->GetSelectedTabContents(); | 1096 TabContents* tab = browser()->GetSelectedTabContents(); |
| 1090 int ordinal = 0; | 1097 int ordinal = 0; |
| 1091 FindInPageWchar(tab, L"link", kFwd, kIgnoreCase, &ordinal); | 1098 FindInPageWchar(tab, L"link", kFwd, kIgnoreCase, &ordinal); |
| 1092 EXPECT_EQ(ordinal, 1); | 1099 EXPECT_EQ(ordinal, 1); |
| 1093 | 1100 |
| 1094 // End the find session, click on the link. | 1101 // End the find session, click on the link. |
| 1095 tab->StopFinding(FindBarController::kActivateSelection); | 1102 tab->StopFinding(FindBarController::kActivateSelection); |
| 1096 EXPECT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); | 1103 EXPECT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); |
| 1097 } | 1104 } |
| OLD | NEW |