OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 VIEW_ID_LOCATION_BAR)); | 107 VIEW_ID_LOCATION_BAR)); |
108 // Check the location bar is focused. | 108 // Check the location bar is focused. |
109 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), | 109 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), |
110 location_bar_focus_view_id_)); | 110 location_bar_focus_view_id_)); |
111 | 111 |
112 // This used to crash until bug 1303709 was fixed. | 112 // This used to crash until bug 1303709 was fixed. |
113 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 113 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
114 browser(), ui::VKEY_ESCAPE, false, false, false, false)); | 114 browser(), ui::VKEY_ESCAPE, false, false, false, false)); |
115 } | 115 } |
116 | 116 |
117 IN_PROC_BROWSER_TEST_F(FindInPageTest, FocusRestore) { | 117 // Fails to start the test server on ChromeOS: http://crbug.com/168974 |
| 118 #if defined(OS_CHROMEOS) |
| 119 #define MAYBE_FocusRestore DISABLED_FocusRestore |
| 120 #else |
| 121 #define MAYBE_FocusRestore FocusRestore |
| 122 #endif |
| 123 IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_FocusRestore) { |
118 ASSERT_TRUE(test_server()->Start()); | 124 ASSERT_TRUE(test_server()->Start()); |
119 | 125 |
120 GURL url = test_server()->GetURL("title1.html"); | 126 GURL url = test_server()->GetURL("title1.html"); |
121 ui_test_utils::NavigateToURL(browser(), url); | 127 ui_test_utils::NavigateToURL(browser(), url); |
122 | 128 |
123 // Focus the location bar, open and close the find-in-page, focus should | 129 // Focus the location bar, open and close the find-in-page, focus should |
124 // return to the location bar. | 130 // return to the location bar. |
125 chrome::FocusLocationBar(browser()); | 131 chrome::FocusLocationBar(browser()); |
126 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), | 132 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), |
127 location_bar_focus_view_id_)); | 133 location_bar_focus_view_id_)); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); | 386 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); |
381 | 387 |
382 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 388 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
383 browser(), ui::VKEY_V, true, false, false, false)); | 389 browser(), ui::VKEY_V, true, false, false, false)); |
384 | 390 |
385 ASSERT_NO_FATAL_FAILURE(observer.Wait()); | 391 ASSERT_NO_FATAL_FAILURE(observer.Wait()); |
386 FindNotificationDetails details; | 392 FindNotificationDetails details; |
387 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); | 393 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); |
388 EXPECT_TRUE(details.number_of_matches() > 0); | 394 EXPECT_TRUE(details.number_of_matches() > 0); |
389 } | 395 } |
OLD | NEW |