OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "chrome/browser/view_ids.h" | 9 #include "chrome/browser/view_ids.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 void SimulateClickInCenterOf(const scoped_refptr<WindowProxy>& window) { | 46 void SimulateClickInCenterOf(const scoped_refptr<WindowProxy>& window) { |
47 gfx::Rect tab_view_bounds; | 47 gfx::Rect tab_view_bounds; |
48 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER, | 48 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER, |
49 &tab_view_bounds, true)); | 49 &tab_view_bounds, true)); |
50 | 50 |
51 // Simulate a click of the actual link to force user_gesture to be | 51 // Simulate a click of the actual link to force user_gesture to be |
52 // true; if we don't, the resulting popup will be constrained, which | 52 // true; if we don't, the resulting popup will be constrained, which |
53 // isn't what we want to test. | 53 // isn't what we want to test. |
54 POINT link_point(tab_view_bounds.CenterPoint().ToPOINT()); | 54 ASSERT_TRUE(window->SimulateOSClick(tab_view_bounds.CenterPoint(), |
55 ASSERT_TRUE(window->SimulateOSClick(link_point, | |
56 views::Event::EF_LEFT_BUTTON_DOWN)); | 55 views::Event::EF_LEFT_BUTTON_DOWN)); |
57 } | 56 } |
58 | 57 |
59 scoped_refptr<BrowserProxy> browser_; | 58 scoped_refptr<BrowserProxy> browser_; |
60 scoped_refptr<WindowProxy> window_; | 59 scoped_refptr<WindowProxy> window_; |
61 scoped_refptr<TabProxy> tab_; | 60 scoped_refptr<TabProxy> tab_; |
62 }; | 61 }; |
63 | 62 |
64 TEST_F(BlockedPopupContainerInteractiveTest, TestOpenAndResizeTo) { | 63 TEST_F(BlockedPopupContainerInteractiveTest, TestOpenAndResizeTo) { |
65 NavigateMainTabTo(L"constrained_window_onload_resizeto.html"); | 64 NavigateMainTabTo(L"constrained_window_onload_resizeto.html"); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 TEST_F(BlockedPopupContainerInteractiveTest, DontBreakOnBlur) { | 222 TEST_F(BlockedPopupContainerInteractiveTest, DontBreakOnBlur) { |
224 NavigateMainTabTo(L"window_blur_test.html"); | 223 NavigateMainTabTo(L"window_blur_test.html"); |
225 SimulateClickInCenterOf(window_); | 224 SimulateClickInCenterOf(window_); |
226 | 225 |
227 // Wait for the popup window to open. | 226 // Wait for the popup window to open. |
228 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, 1000)); | 227 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, 1000)); |
229 | 228 |
230 // We popup shouldn't be closed by the onblur handler. | 229 // We popup shouldn't be closed by the onblur handler. |
231 ASSERT_FALSE(automation()->WaitForWindowCountToBecome(1, 1500)); | 230 ASSERT_FALSE(automation()->WaitForWindowCountToBecome(1, 1500)); |
232 } | 231 } |
OLD | NEW |