diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-14 02:31:13 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-14 02:31:13 +0000 |
commit | c5b64b34cbd3fe0cabc5f0e086810e4277908b9f (patch) | |
tree | 40d9764e49c01aba7ffcd9bacb4699bb16b4c5b0 /chrome/browser | |
parent | 28b2c9f571517b8b5e733d08e8245dc04dd7c7b3 (diff) | |
download | chromium_src-c5b64b34cbd3fe0cabc5f0e086810e4277908b9f.zip chromium_src-c5b64b34cbd3fe0cabc5f0e086810e4277908b9f.tar.gz chromium_src-c5b64b34cbd3fe0cabc5f0e086810e4277908b9f.tar.bz2 |
Fix interactive UI tests...
- in the UI tests, SimulateOSClick was taking screen coordinates and the browser automation provider was treating them as client. For a click, screen coordinates seems better and is what most users were sending. This was causing the focus tests to fail since tabs weren't getting clicked on. Not sure why this wasn't affecting non-new-frames!
- a math error in BrowserView2 was leading to incorrect window sizing in constrained window tests.
- new frames mean layout is slightly different, and a constant in the constrained window test needed to be adjusted.
Review URL: http://codereview.chromium.org/2828
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/constrained_window_impl_interactive_uitest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view2.cc | 15 |
3 files changed, 15 insertions, 8 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 999ca75..4c1ed49 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1229,8 +1229,6 @@ void AutomationProvider::WindowSimulateClick(const IPC::Message& message, if (window_tracker_->ContainsHandle(handle)) { hwnd = window_tracker_->GetResource(handle); - BOOL r = ::ClientToScreen(hwnd, &click); - DCHECK(r); ui_controls::SendMouseMove(click.x, click.y); ui_controls::MouseButton button = ui_controls::LEFT; diff --git a/chrome/browser/views/constrained_window_impl_interactive_uitest.cc b/chrome/browser/views/constrained_window_impl_interactive_uitest.cc index 7f39d1b..69834c8 100644 --- a/chrome/browser/views/constrained_window_impl_interactive_uitest.cc +++ b/chrome/browser/views/constrained_window_impl_interactive_uitest.cc @@ -16,7 +16,7 @@ #include "net/base/net_util.h" const int kRightCloseButtonOffset = 55; -const int kBottomCloseButtonOffset = 25; +const int kBottomCloseButtonOffset = 20; class InteractiveConstrainedWindowTest : public UITest { protected: @@ -67,8 +67,8 @@ TEST_F(InteractiveConstrainedWindowTest, TestOpenAndResizeTo) { ASSERT_TRUE(popup_window->GetViewBoundsWithTimeout( VIEW_ID_TAB_CONTAINER, &rect, false, 1000, &is_timeout)); ASSERT_FALSE(is_timeout); - ASSERT_EQ(rect.width(), 300); - ASSERT_EQ(rect.height(), 320); + ASSERT_EQ(300, rect.width()); + ASSERT_EQ(320, rect.height()); // Send a click to the popup window to test resizeTo. ASSERT_TRUE(popup_window->GetViewBounds(VIEW_ID_TAB_CONTAINER, diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index e72ec22..d0d724c 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -33,16 +33,24 @@ // static SkBitmap BrowserView2::default_favicon_; SkBitmap BrowserView2::otr_avatar_; +// The vertical overlap between the TabStrip and the Toolbar. static const int kToolbarTabStripVerticalOverlap = 3; +// The visible height of the shadow above the tabs. Clicks in this area are +// treated as clicks to the frame, rather than clicks to the tab. static const int kTabShadowSize = 2; +// The height of the status bubble. static const int kStatusBubbleHeight = 20; +// The distance of the status bubble from the left edge of the window. static const int kStatusBubbleOffset = 2; +// An offset distance between certain toolbars and the toolbar that preceded +// them in layout. static const int kSeparationLineHeight = 1; -static const SkColor kSeparationLineColor = SkColorSetRGB(178, 178, 178); +// The name of a key to store on the window handle so that other code can +// locate this object using just the handle. static const wchar_t* kBrowserWindowKey = L"__BROWSER_WINDOW__"; +// The distance between tiled windows. static const int kWindowTilePixels = 10; - static const struct { bool separator; int command; int label; } kMenuLayout[] = { { true, 0, 0 }, { false, IDC_TASKMANAGER, IDS_TASKMANAGER }, @@ -854,7 +862,8 @@ int BrowserView2::LayoutToolbar(int top) { if (IsToolbarVisible()) { CSize ps; toolbar_->GetPreferredSize(&ps); - int toolbar_y = top - kToolbarTabStripVerticalOverlap; + int toolbar_y = + top - (IsTabStripVisible() ? kToolbarTabStripVerticalOverlap : 0); // With detached popup windows with the aero glass frame, we need to offset // by a pixel to make things look good. if (!IsTabStripVisible() && win_util::ShouldUseVistaFrame()) |