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/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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Focus the location bar, find something on the page, close the find box, | 128 // Focus the location bar, find something on the page, close the find box, |
129 // focus should go to the page. | 129 // focus should go to the page. |
130 browser()->FocusLocationBar(); | 130 browser()->FocusLocationBar(); |
131 browser()->Find(); | 131 browser()->Find(); |
132 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), | 132 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), |
133 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); | 133 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); |
134 ui_test_utils::FindInPage(browser()->GetSelectedTabContentsWrapper(), | 134 ui_test_utils::FindInPage(browser()->GetSelectedTabContentsWrapper(), |
135 ASCIIToUTF16("a"), true, false, NULL); | 135 ASCIIToUTF16("a"), true, false, NULL); |
136 browser()->GetFindBarController()->EndFindSession( | 136 browser()->GetFindBarController()->EndFindSession( |
137 FindBarController::kKeepSelection); | 137 FindBarController::kKeepSelection); |
138 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_TAB_CONTAINER)); | 138 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), |
| 139 VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); |
139 | 140 |
140 // Focus the location bar, open and close the find box, focus should return to | 141 // Focus the location bar, open and close the find box, focus should return to |
141 // the location bar (same as before, just checking that http://crbug.com/23599 | 142 // the location bar (same as before, just checking that http://crbug.com/23599 |
142 // is fixed). | 143 // is fixed). |
143 browser()->FocusLocationBar(); | 144 browser()->FocusLocationBar(); |
144 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), | 145 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), |
145 location_bar_focus_view_id_)); | 146 location_bar_focus_view_id_)); |
146 browser()->GetFindBarController()->Show(); | 147 browser()->GetFindBarController()->Show(); |
147 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), | 148 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), |
148 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); | 149 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); | 354 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); |
354 | 355 |
355 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 356 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
356 browser(), ui::VKEY_V, true, false, false, false)); | 357 browser(), ui::VKEY_V, true, false, false, false)); |
357 | 358 |
358 ASSERT_NO_FATAL_FAILURE(observer.Wait()); | 359 ASSERT_NO_FATAL_FAILURE(observer.Wait()); |
359 FindNotificationDetails details; | 360 FindNotificationDetails details; |
360 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); | 361 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); |
361 EXPECT_TRUE(details.number_of_matches() > 0); | 362 EXPECT_TRUE(details.number_of_matches() > 0); |
362 } | 363 } |
OLD | NEW |