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/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 void MouseLeaveTestCommon() { | 22 void MouseLeaveTestCommon() { |
23 GURL test_url = ui_test_utils::GetTestUrl( | 23 GURL test_url = ui_test_utils::GetTestUrl( |
24 base::FilePath(), base::FilePath(FILE_PATH_LITERAL("mouseleave.html"))); | 24 base::FilePath(), base::FilePath(FILE_PATH_LITERAL("mouseleave.html"))); |
25 | 25 |
26 content::WebContents* tab = | 26 content::WebContents* tab = |
27 browser()->tab_strip_model()->GetActiveWebContents(); | 27 browser()->tab_strip_model()->GetActiveWebContents(); |
28 gfx::Rect tab_view_bounds = tab->GetContainerBounds(); | 28 gfx::Rect tab_view_bounds = tab->GetContainerBounds(); |
29 | 29 |
30 gfx::Point in_content_point( | 30 gfx::Point in_content_point( |
31 tab_view_bounds.x() + tab_view_bounds.width() / 2, | 31 tab_view_bounds.x() + tab_view_bounds.width() / 2, |
32 tab_view_bounds.y() + 10); | 32 tab_view_bounds.y() + 200); |
sky
2014/12/01 17:28:28
I'm not familiar with this test and it has a lot o
| |
33 gfx::Point above_content_point( | 33 gfx::Point above_content_point( |
34 tab_view_bounds.x() + tab_view_bounds.width() / 2, | 34 tab_view_bounds.x() + tab_view_bounds.width() / 2, |
35 tab_view_bounds.y() - 2); | 35 tab_view_bounds.y() - 2); |
36 | 36 |
37 // Start by moving the point just above the content. | 37 // Start by moving the point just above the content. |
38 ui_controls::SendMouseMove(above_content_point.x(), | 38 ui_controls::SendMouseMove(above_content_point.x(), |
39 above_content_point.y()); | 39 above_content_point.y()); |
40 | 40 |
41 // Navigate to the test html page. | 41 // Navigate to the test html page. |
42 base::string16 load_expected_title(base::ASCIIToUTF16("onload")); | 42 base::string16 load_expected_title(base::ASCIIToUTF16("onload")); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 gfx::Rect browser_bounds = browser()->window()->GetBounds(); | 89 gfx::Rect browser_bounds = browser()->window()->GetBounds(); |
90 ui_controls::SendMouseMove(browser_bounds.x() + 200, | 90 ui_controls::SendMouseMove(browser_bounds.x() + 200, |
91 browser_bounds.y() + 10); | 91 browser_bounds.y() + 10); |
92 ui_controls::SendMouseClick(ui_controls::LEFT); | 92 ui_controls::SendMouseClick(ui_controls::LEFT); |
93 | 93 |
94 MouseLeaveTestCommon(); | 94 MouseLeaveTestCommon(); |
95 } | 95 } |
96 #endif | 96 #endif |
97 | 97 |
98 } // namespace | 98 } // namespace |
OLD | NEW |