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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc

Issue 1858773006: [Extensions UI] Use the ExtensionMessageBubbleBridge for Views platforms (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 | « chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc
index 4813548f5824b017329bfe0a63876220d52acde0..147dba02c403e23258b418e0723e29d75fa6cabe 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc
@@ -157,3 +157,25 @@ TEST_F(ToolbarActionsBarBubbleViewsTest, TestCloseOnDeactivation) {
*delegate.close_action());
EXPECT_TRUE(bubble_observer.widget_closed());
}
+
+TEST_F(ToolbarActionsBarBubbleViewsTest, TestDontCloseOnDeactivation) {
+ scoped_ptr<views::Widget> anchor_widget = CreateAnchorWidget();
+ TestToolbarActionsBarBubbleDelegate delegate(HeadingString(), BodyString(),
+ ActionString());
+ delegate.set_dismiss_button_text(DismissString());
+ delegate.set_close_on_deactivate(false);
+ ToolbarActionsBarBubbleViews* bubble = new ToolbarActionsBarBubbleViews(
+ anchor_widget->GetContentsView(), delegate.GetDelegate());
+ views::Widget* bubble_widget =
+ views::BubbleDelegateView::CreateBubble(bubble);
+ views::test::TestWidgetObserver bubble_observer(bubble_widget);
+ bubble->Show();
+
+ EXPECT_FALSE(delegate.close_action());
+ // Activate another widget. The bubble shouldn't close.
+ anchor_widget->Activate();
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(delegate.close_action());
+ bubble_widget->Close();
+ base::RunLoop().RunUntilIdle();
+}
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698