OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/process_util.h" | 5 #include "base/process_util.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 10 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 string16 GetFindBarSelectedText() { | 50 string16 GetFindBarSelectedText() { |
51 FindBarTesting* find_bar = | 51 FindBarTesting* find_bar = |
52 browser()->GetFindBarController()->find_bar()->GetFindBarTesting(); | 52 browser()->GetFindBarController()->find_bar()->GetFindBarTesting(); |
53 return find_bar->GetFindSelectedText(); | 53 return find_bar->GetFindSelectedText(); |
54 } | 54 } |
55 }; | 55 }; |
56 | 56 |
57 } // namespace | 57 } // namespace |
58 | 58 |
59 IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) { | 59 #if defined(TOOLKIT_USES_GTK) |
| 60 #define MAYBE_CrashEscHandlers FLAKY_CrashEscHandlers |
| 61 #else |
| 62 #define MAYBE_CrashEscHandlers CrashEscHandlers |
| 63 #endif |
| 64 |
| 65 IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_CrashEscHandlers) { |
60 ASSERT_TRUE(test_server()->Start()); | 66 ASSERT_TRUE(test_server()->Start()); |
61 | 67 |
62 // First we navigate to our test page (tab A). | 68 // First we navigate to our test page (tab A). |
63 GURL url = test_server()->GetURL(kSimplePage); | 69 GURL url = test_server()->GetURL(kSimplePage); |
64 ui_test_utils::NavigateToURL(browser(), url); | 70 ui_test_utils::NavigateToURL(browser(), url); |
65 | 71 |
66 browser()->Find(); | 72 browser()->Find(); |
67 | 73 |
68 // Open another tab (tab B). | 74 // Open another tab (tab B). |
69 browser()->AddSelectedTabWithURL(url, PageTransition::TYPED); | 75 browser()->AddSelectedTabWithURL(url, PageTransition::TYPED); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 NotificationType::FIND_RESULT_AVAILABLE, notification_source); | 328 NotificationType::FIND_RESULT_AVAILABLE, notification_source); |
323 | 329 |
324 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 330 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
325 browser(), ui::VKEY_V, true, false, false, false)); | 331 browser(), ui::VKEY_V, true, false, false, false)); |
326 | 332 |
327 ASSERT_NO_FATAL_FAILURE(observer.Wait()); | 333 ASSERT_NO_FATAL_FAILURE(observer.Wait()); |
328 FindNotificationDetails details; | 334 FindNotificationDetails details; |
329 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); | 335 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); |
330 EXPECT_TRUE(details.number_of_matches() > 0); | 336 EXPECT_TRUE(details.number_of_matches() > 0); |
331 } | 337 } |
OLD | NEW |