| 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 | 5 |
| 6 #include "chrome/browser/view_ids.h" | 6 #include "chrome/browser/view_ids.h" |
| 7 #include "chrome/views/view.h" | 7 #include "chrome/views/view.h" |
| 8 #include "chrome/test/automation/browser_proxy.h" | 8 #include "chrome/test/automation/browser_proxy.h" |
| 9 #include "chrome/test/automation/window_proxy.h" | 9 #include "chrome/test/automation/window_proxy.h" |
| 10 #include "chrome/test/automation/tab_proxy.h" | 10 #include "chrome/test/automation/tab_proxy.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return true; | 49 return true; |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 TEST_F(FindInPageTest, CrashEscHandlers) { | 54 TEST_F(FindInPageTest, CrashEscHandlers) { |
| 55 scoped_refptr<HTTPTestServer> server = | 55 scoped_refptr<HTTPTestServer> server = |
| 56 HTTPTestServer::CreateServer(kDocRoot, NULL); | 56 HTTPTestServer::CreateServer(kDocRoot, NULL); |
| 57 ASSERT_TRUE(NULL != server.get()); | 57 ASSERT_TRUE(NULL != server.get()); |
| 58 | 58 |
| 59 scoped_ptr<BrowserProxy> browser(automation()->GetLastActiveBrowserWindow()); | 59 scoped_ptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 60 ASSERT_TRUE(browser.get() != NULL); | 60 ASSERT_TRUE(browser.get() != NULL); |
| 61 scoped_ptr<WindowProxy> window(browser->GetWindow()); | 61 scoped_ptr<WindowProxy> window(browser->GetWindow()); |
| 62 ASSERT_TRUE(window.get() != NULL); | 62 ASSERT_TRUE(window.get() != NULL); |
| 63 | 63 |
| 64 // First we navigate to our test page (tab A). | 64 // First we navigate to our test page (tab A). |
| 65 GURL url = server->TestServerPageW(kSimplePage); | 65 GURL url = server->TestServerPageW(kSimplePage); |
| 66 scoped_ptr<TabProxy> tabA(GetActiveTab()); | 66 scoped_ptr<TabProxy> tabA(GetActiveTab()); |
| 67 EXPECT_NE(AUTOMATION_MSG_NAVIGATION_ERROR, tabA->NavigateToURL(url)); | 67 EXPECT_NE(AUTOMATION_MSG_NAVIGATION_ERROR, tabA->NavigateToURL(url)); |
| 68 | 68 |
| 69 EXPECT_TRUE(browser->OpenFindInPage()); | 69 EXPECT_TRUE(browser->OpenFindInPage()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 88 views::Event::EF_LEFT_BUTTON_DOWN)); | 88 views::Event::EF_LEFT_BUTTON_DOWN)); |
| 89 ::Sleep(kActionDelayMs); | 89 ::Sleep(kActionDelayMs); |
| 90 int focused_view_id; | 90 int focused_view_id; |
| 91 EXPECT_TRUE(window->GetFocusedViewID(&focused_view_id)); | 91 EXPECT_TRUE(window->GetFocusedViewID(&focused_view_id)); |
| 92 EXPECT_EQ(VIEW_ID_LOCATION_BAR, focused_view_id); | 92 EXPECT_EQ(VIEW_ID_LOCATION_BAR, focused_view_id); |
| 93 | 93 |
| 94 // This used to crash until bug 1303709 was fixed. | 94 // This used to crash until bug 1303709 was fixed. |
| 95 EXPECT_TRUE(window->SimulateOSKeyPress(VK_ESCAPE, 0)); | 95 EXPECT_TRUE(window->SimulateOSKeyPress(VK_ESCAPE, 0)); |
| 96 ::Sleep(kActionDelayMs); | 96 ::Sleep(kActionDelayMs); |
| 97 } | 97 } |
| OLD | NEW |