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/message_loop.h" | 5 #include "base/message_loop.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/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/tabs/tab_strip_model.h" | 9 #include "chrome/browser/tabs/tab_strip_model.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 EXPECT_TRUE(new_target != NULL); | 775 EXPECT_TRUE(new_target != NULL); |
776 EXPECT_NE(new_target, old_target); | 776 EXPECT_NE(new_target, old_target); |
777 | 777 |
778 // Close the Find box. | 778 // Close the Find box. |
779 browser()->GetFindBarController()->EndFindSession( | 779 browser()->GetFindBarController()->EndFindSession( |
780 FindBarController::kKeepSelection); | 780 FindBarController::kKeepSelection); |
781 | 781 |
782 // The accelerator for Escape should be back to what it was before. | 782 // The accelerator for Escape should be back to what it was before. |
783 EXPECT_EQ(old_target, | 783 EXPECT_EQ(old_target, |
784 focus_manager->GetCurrentTargetForAccelerator(escape)); | 784 focus_manager->GetCurrentTargetForAccelerator(escape)); |
| 785 |
| 786 // Show find bar again with animation on, and the target should be |
| 787 // on find bar. |
| 788 DropdownBarHost::disable_animations_during_testing_ = false; |
| 789 browser()->ShowFindBar(); |
| 790 EXPECT_EQ(new_target, |
| 791 focus_manager->GetCurrentTargetForAccelerator(escape)); |
785 } | 792 } |
786 #endif // TOOLKIT_VIEWS | 793 #endif // TOOLKIT_VIEWS |
787 | 794 |
788 // Make sure Find box does not become UI-inactive when no text is in the box as | 795 // Make sure Find box does not become UI-inactive when no text is in the box as |
789 // we switch to a tab contents with an empty find string. See issue 13570. | 796 // we switch to a tab contents with an empty find string. See issue 13570. |
790 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, StayActive) { | 797 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, StayActive) { |
791 ASSERT_TRUE(test_server()->Start()); | 798 ASSERT_TRUE(test_server()->Start()); |
792 | 799 |
793 // First we navigate to any page. | 800 // First we navigate to any page. |
794 GURL url = test_server()->GetURL(kSimplePage); | 801 GURL url = test_server()->GetURL(kSimplePage); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 MessageLoop::current()->RunAllPending(); | 1129 MessageLoop::current()->RunAllPending(); |
1123 | 1130 |
1124 EnsureFindBoxOpenForBrowser(popup); | 1131 EnsureFindBoxOpenForBrowser(popup); |
1125 | 1132 |
1126 // GTK adjusts FindBar size asynchronously. | 1133 // GTK adjusts FindBar size asynchronously. |
1127 MessageLoop::current()->RunAllPending(); | 1134 MessageLoop::current()->RunAllPending(); |
1128 | 1135 |
1129 ASSERT_LE(GetFindBarWidthForBrowser(popup), | 1136 ASSERT_LE(GetFindBarWidthForBrowser(popup), |
1130 popup->window()->GetBounds().width()); | 1137 popup->window()->GetBounds().width()); |
1131 } | 1138 } |
OLD | NEW |