| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 AutofillManager* autofill_manager = autofill_driver->autofill_manager(); | 152 AutofillManager* autofill_manager = autofill_driver->autofill_manager(); |
| 153 autofill_manager->SetTestDelegate(&test_delegate_); | 153 autofill_manager->SetTestDelegate(&test_delegate_); |
| 154 | 154 |
| 155 // If the mouse happened to be over where the suggestions are shown, then | 155 // If the mouse happened to be over where the suggestions are shown, then |
| 156 // the preview will show up and will fail the tests. We need to give it a | 156 // the preview will show up and will fail the tests. We need to give it a |
| 157 // point that's within the browser frame, or else the method hangs. | 157 // point that's within the browser frame, or else the method hangs. |
| 158 gfx::Point reset_mouse(GetWebContents()->GetContainerBounds().origin()); | 158 gfx::Point reset_mouse(GetWebContents()->GetContainerBounds().origin()); |
| 159 reset_mouse = gfx::Point(reset_mouse.x() + 5, reset_mouse.y() + 5); | 159 reset_mouse = gfx::Point(reset_mouse.x() + 5, reset_mouse.y() + 5); |
| 160 ASSERT_TRUE(ui_test_utils::SendMouseMoveSync(reset_mouse)); | 160 ASSERT_TRUE(ui_test_utils::SendMouseMoveSync(reset_mouse)); |
| 161 | 161 |
| 162 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 162 ASSERT_TRUE(embedded_test_server()->Start()); |
| 163 InProcessBrowserTest::SetUpOnMainThread(); | 163 InProcessBrowserTest::SetUpOnMainThread(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void TearDownOnMainThread() override { | 166 void TearDownOnMainThread() override { |
| 167 // Make sure to close any showing popups prior to tearing down the UI. | 167 // Make sure to close any showing popups prior to tearing down the UI. |
| 168 content::WebContents* web_contents = GetWebContents(); | 168 content::WebContents* web_contents = GetWebContents(); |
| 169 AutofillManager* autofill_manager = | 169 AutofillManager* autofill_manager = |
| 170 ContentAutofillDriverFactory::FromWebContents(web_contents) | 170 ContentAutofillDriverFactory::FromWebContents(web_contents) |
| 171 ->DriverForFrame(web_contents->GetMainFrame()) | 171 ->DriverForFrame(web_contents->GetMainFrame()) |
| 172 ->autofill_manager(); | 172 ->autofill_manager(); |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 ASSERT_TRUE(content::ExecuteScript( | 1390 ASSERT_TRUE(content::ExecuteScript( |
| 1391 GetRenderViewHost(), | 1391 GetRenderViewHost(), |
| 1392 "document.querySelector('input').autocomplete = 'off';")); | 1392 "document.querySelector('input').autocomplete = 'off';")); |
| 1393 | 1393 |
| 1394 // Press the down arrow to select the suggestion and attempt to preview the | 1394 // Press the down arrow to select the suggestion and attempt to preview the |
| 1395 // autofilled form. | 1395 // autofilled form. |
| 1396 SendKeyToPopupAndWait(ui::VKEY_DOWN); | 1396 SendKeyToPopupAndWait(ui::VKEY_DOWN); |
| 1397 } | 1397 } |
| 1398 | 1398 |
| 1399 } // namespace autofill | 1399 } // namespace autofill |
| OLD | NEW |