| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/keyboard_codes.h" | 5 #include "base/keyboard_codes.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "chrome/browser/automation/ui_controls.h" | 7 #include "chrome/browser/automation/ui_controls.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
| 10 #include "chrome/browser/find_bar_controller.h" | 10 #include "chrome/browser/find_bar_controller.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // Click on the location bar so that Find box loses focus. | 107 // Click on the location bar so that Find box loses focus. |
| 108 ClickOnView(VIEW_ID_LOCATION_BAR); | 108 ClickOnView(VIEW_ID_LOCATION_BAR); |
| 109 #if defined(TOOLKIT_VIEWS) || defined(OS_WIN) | 109 #if defined(TOOLKIT_VIEWS) || defined(OS_WIN) |
| 110 // Check the location bar is focused. | 110 // Check the location bar is focused. |
| 111 EXPECT_EQ(VIEW_ID_LOCATION_BAR, GetFocusedViewID()); | 111 EXPECT_EQ(VIEW_ID_LOCATION_BAR, GetFocusedViewID()); |
| 112 #endif | 112 #endif |
| 113 | 113 |
| 114 // This used to crash until bug 1303709 was fixed. | 114 // This used to crash until bug 1303709 was fixed. |
| 115 ui_controls::SendKeyPressNotifyWhenDone( | 115 ui_controls::SendKeyPressNotifyWhenDone( |
| 116 browser()->window()->GetNativeHandle(), base::VKEY_ESCAPE, | 116 browser()->window()->GetNativeHandle(), base::VKEY_ESCAPE, |
| 117 false, false, false, new MessageLoop::QuitTask()); | 117 false, false, false, false, new MessageLoop::QuitTask()); |
| 118 ui_test_utils::RunMessageLoop(); | 118 ui_test_utils::RunMessageLoop(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 IN_PROC_BROWSER_TEST_F(FindInPageTest, FocusRestore) { | 121 IN_PROC_BROWSER_TEST_F(FindInPageTest, FocusRestore) { |
| 122 scoped_refptr<HTTPTestServer> server = | 122 scoped_refptr<HTTPTestServer> server = |
| 123 HTTPTestServer::CreateServer(kDocRoot, NULL); | 123 HTTPTestServer::CreateServer(kDocRoot, NULL); |
| 124 ASSERT_TRUE(NULL != server.get()); | 124 ASSERT_TRUE(NULL != server.get()); |
| 125 | 125 |
| 126 GURL url = server->TestServerPageW(L"title1.html"); | 126 GURL url = server->TestServerPageW(L"title1.html"); |
| 127 ui_test_utils::NavigateToURL(browser(), url); | 127 ui_test_utils::NavigateToURL(browser(), url); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 152 // the location bar (same as before, just checking that http://crbug.com/23599 | 152 // the location bar (same as before, just checking that http://crbug.com/23599 |
| 153 // is fixed). | 153 // is fixed). |
| 154 browser()->FocusLocationBar(); | 154 browser()->FocusLocationBar(); |
| 155 EXPECT_EQ(VIEW_ID_LOCATION_BAR, GetFocusedViewID()); | 155 EXPECT_EQ(VIEW_ID_LOCATION_BAR, GetFocusedViewID()); |
| 156 browser()->GetFindBarController()->Show(); | 156 browser()->GetFindBarController()->Show(); |
| 157 EXPECT_EQ(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD, GetFocusedViewID()); | 157 EXPECT_EQ(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD, GetFocusedViewID()); |
| 158 browser()->GetFindBarController()->EndFindSession( | 158 browser()->GetFindBarController()->EndFindSession( |
| 159 FindBarController::kKeepSelection); | 159 FindBarController::kKeepSelection); |
| 160 EXPECT_EQ(VIEW_ID_LOCATION_BAR, GetFocusedViewID()); | 160 EXPECT_EQ(VIEW_ID_LOCATION_BAR, GetFocusedViewID()); |
| 161 } | 161 } |
| OLD | NEW |