Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 ASSERT_TRUE(menu != NULL); 1490 ASSERT_TRUE(menu != NULL);
1491 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); 1491 ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
1492 views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(1); 1492 views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(1);
1493 ASSERT_TRUE(child_menu != NULL); 1493 ASSERT_TRUE(child_menu != NULL);
1494 1494
1495 // The context menu and child_menu can be overlapped, calculate the 1495 // The context menu and child_menu can be overlapped, calculate the
1496 // non-intersected Rect of the child menu and click on its center to make 1496 // non-intersected Rect of the child menu and click on its center to make
1497 // sure the click is always on the child menu. 1497 // sure the click is always on the child menu.
1498 gfx::Rect context_rect = context_menu->GetSubmenu()->GetBoundsInScreen(); 1498 gfx::Rect context_rect = context_menu->GetSubmenu()->GetBoundsInScreen();
1499 gfx::Rect child_menu_rect = child_menu->GetBoundsInScreen(); 1499 gfx::Rect child_menu_rect = child_menu->GetBoundsInScreen();
1500 gfx::Rect clickable_rect = child_menu_rect.Subtract(context_rect); 1500 gfx::Rect clickable_rect = child_menu_rect;
1501 clickable_rect.Subtract(context_rect);
1501 ASSERT_FALSE(clickable_rect.IsEmpty()); 1502 ASSERT_FALSE(clickable_rect.IsEmpty());
1502 observer_.set_task(CreateEventTask(this, &BookmarkBarViewTest17::Step4)); 1503 observer_.set_task(CreateEventTask(this, &BookmarkBarViewTest17::Step4));
1503 MoveMouseAndPress(clickable_rect.CenterPoint(), ui_controls::RIGHT, 1504 MoveMouseAndPress(clickable_rect.CenterPoint(), ui_controls::RIGHT,
1504 ui_controls::DOWN | ui_controls::UP, base::Closure()); 1505 ui_controls::DOWN | ui_controls::UP, base::Closure());
1505 // Step4 will be invoked by ContextMenuNotificationObserver. 1506 // Step4 will be invoked by ContextMenuNotificationObserver.
1506 } 1507 }
1507 1508
1508 void Step4() { 1509 void Step4() {
1509 // The context menu should still be showing. 1510 // The context menu should still be showing.
1510 views::MenuItemView* context_menu = bb_view_->GetContextMenu(); 1511 views::MenuItemView* context_menu = bb_view_->GetContextMenu();
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 Done(); 1651 Done();
1651 } 1652 }
1652 }; 1653 };
1653 1654
1654 #if defined(OS_WIN) 1655 #if defined(OS_WIN)
1655 #define MAYBE_BookmarkBarViewTest19_SiblingMenu DISABLED_SiblingMenu 1656 #define MAYBE_BookmarkBarViewTest19_SiblingMenu DISABLED_SiblingMenu
1656 #else 1657 #else
1657 #define MAYBE_BookmarkBarViewTest19_SiblingMenu SiblingMenu 1658 #define MAYBE_BookmarkBarViewTest19_SiblingMenu SiblingMenu
1658 #endif 1659 #endif
1659 VIEW_TEST(BookmarkBarViewTest19, MAYBE_BookmarkBarViewTest19_SiblingMenu) 1660 VIEW_TEST(BookmarkBarViewTest19, MAYBE_BookmarkBarViewTest19_SiblingMenu)
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/dock_info.cc ('k') | chrome/browser/ui/views/extensions/extension_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698