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/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_tabstrip.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
10 #include "chrome/test/base/ui_controls.h" | 10 #include "chrome/test/base/ui_controls.h" |
11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 #include "content/public/browser/web_contents_view.h" | 13 #include "content/public/browser/web_contents_view.h" |
14 #include "content/public/test/browser_test_utils.h" | 14 #include "content/public/test/browser_test_utils.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 class MouseLeaveTest : public InProcessBrowserTest { | 18 class MouseLeaveTest : public InProcessBrowserTest { |
(...skipping 10 matching lines...) Expand all Loading... |
29 // http://crbug.com/133361 | 29 // http://crbug.com/133361 |
30 #define MAYBE_TestOnMouseOut DISABLED_TestOnMouseOut | 30 #define MAYBE_TestOnMouseOut DISABLED_TestOnMouseOut |
31 #else | 31 #else |
32 #define MAYBE_TestOnMouseOut TestOnMouseOut | 32 #define MAYBE_TestOnMouseOut TestOnMouseOut |
33 #endif | 33 #endif |
34 | 34 |
35 IN_PROC_BROWSER_TEST_F(MouseLeaveTest, MAYBE_TestOnMouseOut) { | 35 IN_PROC_BROWSER_TEST_F(MouseLeaveTest, MAYBE_TestOnMouseOut) { |
36 GURL test_url = ui_test_utils::GetTestUrl( | 36 GURL test_url = ui_test_utils::GetTestUrl( |
37 FilePath(), FilePath(FILE_PATH_LITERAL("mouseleave.html"))); | 37 FilePath(), FilePath(FILE_PATH_LITERAL("mouseleave.html"))); |
38 | 38 |
39 content::WebContents* tab = chrome::GetActiveWebContents(browser()); | 39 content::WebContents* tab = |
| 40 browser()->tab_strip_model()->GetActiveWebContents(); |
40 gfx::Rect tab_view_bounds; | 41 gfx::Rect tab_view_bounds; |
41 tab->GetView()->GetContainerBounds(&tab_view_bounds); | 42 tab->GetView()->GetContainerBounds(&tab_view_bounds); |
42 | 43 |
43 gfx::Point in_content_point( | 44 gfx::Point in_content_point( |
44 tab_view_bounds.x() + tab_view_bounds.width() / 2, | 45 tab_view_bounds.x() + tab_view_bounds.width() / 2, |
45 tab_view_bounds.y() + 10); | 46 tab_view_bounds.y() + 10); |
46 gfx::Point above_content_point( | 47 gfx::Point above_content_point( |
47 tab_view_bounds.x() + tab_view_bounds.width() / 2, | 48 tab_view_bounds.x() + tab_view_bounds.width() / 2, |
48 tab_view_bounds.y() - 2); | 49 tab_view_bounds.y() - 2); |
49 | 50 |
(...skipping 21 matching lines...) Expand all Loading... |
71 // a javascript onMouseOut event. | 72 // a javascript onMouseOut event. |
72 ui_controls::SendMouseMove(above_content_point.x(), above_content_point.y()); | 73 ui_controls::SendMouseMove(above_content_point.x(), above_content_point.y()); |
73 | 74 |
74 // Wait on the correct final value of the cookie. | 75 // Wait on the correct final value of the cookie. |
75 string16 left_expected_title(ASCIIToUTF16("left")); | 76 string16 left_expected_title(ASCIIToUTF16("left")); |
76 content::TitleWatcher left_title_watcher(tab, left_expected_title); | 77 content::TitleWatcher left_title_watcher(tab, left_expected_title); |
77 EXPECT_EQ(left_expected_title, left_title_watcher.WaitAndGetTitle()); | 78 EXPECT_EQ(left_expected_title, left_title_watcher.WaitAndGetTitle()); |
78 } | 79 } |
79 | 80 |
80 } // namespace | 81 } // namespace |
OLD | NEW |