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