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

Unified Diff: chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc

Issue 1877143002: Convert ToolbarActionsBarBubbleViews to BubbleDialogDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/settings_api_bubble_helper_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc
diff --git a/chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc b/chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc
index 4451a34e774705a82c34020ec60497486f17b2e1..ed748443dd8c8e7819188820ac05477b96d41fe7 100644
--- a/chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc
+++ b/chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc
@@ -20,24 +20,19 @@ ToolbarView* GetToolbarViewForBrowser(Browser* browser) {
// Checks that the |bubble| is using the |expected_reference_view|, and is in
// approximately the correct position.
-void CheckBubbleAndReferenceView(views::BubbleDelegateView* bubble,
+void CheckBubbleAndReferenceView(views::BubbleDialogDelegateView* bubble,
views::View* expected_reference_view) {
ASSERT_TRUE(bubble);
ASSERT_TRUE(expected_reference_view);
EXPECT_EQ(expected_reference_view, bubble->GetAnchorView());
// Do a rough check that the bubble is in the right place.
- gfx::Rect bubble_bounds = bubble->GetBoundsInScreen();
+ gfx::Rect bubble_bounds = bubble->GetWidget()->GetWindowBoundsInScreen();
gfx::Rect reference_bounds = expected_reference_view->GetBoundsInScreen();
// It should be below the reference view, but not too far below.
- EXPECT_GE(bubble_bounds.y(), reference_bounds.bottom());
- // "Too far below" is kind of ambiguous. The exact logic of where a bubble
- // is positioned with respect to its anchor view should be tested as part of
- // the bubble logic, but we still want to make sure we didn't accidentally
- // place it somewhere crazy (which can happen if we draw it, and then
- // animate or reposition the reference view).
- const int kFudgeFactor = 50;
- EXPECT_LE(bubble_bounds.y(), reference_bounds.bottom() + kFudgeFactor);
+ EXPECT_GE(bubble_bounds.y(), reference_bounds.y());
+ // The arrow should be poking into the anchor.
+ EXPECT_LE(bubble_bounds.y(), reference_bounds.bottom());
// The bubble should intersect the reference view somewhere along the x-axis.
EXPECT_FALSE(bubble_bounds.x() > reference_bounds.right());
EXPECT_FALSE(reference_bounds.x() > bubble_bounds.right());
@@ -69,7 +64,7 @@ void ExtensionMessageBubbleViewBrowserTest::CheckBubble(Browser* browser,
AnchorPosition anchor) {
ToolbarView* toolbar_view = GetToolbarViewForBrowser(browser);
BrowserActionsContainer* container = toolbar_view->browser_actions();
- views::BubbleDelegateView* bubble = container->active_bubble();
+ views::BubbleDialogDelegateView* bubble = container->active_bubble();
views::View* anchor_view = nullptr;
switch (anchor) {
case ANCHOR_BROWSER_ACTION:
@@ -85,7 +80,7 @@ void ExtensionMessageBubbleViewBrowserTest::CheckBubble(Browser* browser,
void ExtensionMessageBubbleViewBrowserTest::CloseBubble(Browser* browser) {
BrowserActionsContainer* container =
GetToolbarViewForBrowser(browser)->browser_actions();
- views::BubbleDelegateView* bubble = container->active_bubble();
+ views::BubbleDialogDelegateView* bubble = container->active_bubble();
ASSERT_TRUE(bubble);
bubble->GetWidget()->Close();
EXPECT_EQ(nullptr, container->active_bubble());
« no previous file with comments | « no previous file | chrome/browser/ui/views/settings_api_bubble_helper_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698