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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc

Issue 2859333003: cros: Fix bubble dialog shows on desktop when parent window is invisible (Closed)
Patch Set: just create widget on stack Created 3 years, 7 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
« no previous file with comments | « no previous file | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 anchor_widget_.reset(); 55 anchor_widget_.reset();
56 views::ViewsTestBase::TearDown(); 56 views::ViewsTestBase::TearDown();
57 } 57 }
58 58
59 std::unique_ptr<views::Widget> CreateAnchorWidget() { 59 std::unique_ptr<views::Widget> CreateAnchorWidget() {
60 std::unique_ptr<views::Widget> anchor_widget(new views::Widget()); 60 std::unique_ptr<views::Widget> anchor_widget(new views::Widget());
61 views::Widget::InitParams params = 61 views::Widget::InitParams params =
62 CreateParams(views::Widget::InitParams::TYPE_WINDOW); 62 CreateParams(views::Widget::InitParams::TYPE_WINDOW);
63 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 63 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
64 anchor_widget->Init(params); 64 anchor_widget->Init(params);
65 anchor_widget->Show();
65 return anchor_widget; 66 return anchor_widget;
66 } 67 }
67 68
68 void ShowBubble(TestToolbarActionsBarBubbleDelegate* delegate) { 69 void ShowBubble(TestToolbarActionsBarBubbleDelegate* delegate) {
69 ASSERT_TRUE(delegate); 70 ASSERT_TRUE(delegate);
70 ASSERT_FALSE(bubble_widget_); 71 ASSERT_FALSE(bubble_widget_);
71 ASSERT_FALSE(bubble_); 72 ASSERT_FALSE(bubble_);
72 anchor_widget_ = CreateAnchorWidget(); 73 anchor_widget_ = CreateAnchorWidget();
73 bool anchored_to_action = false; 74 bool anchored_to_action = false;
74 bubble_ = new ToolbarActionsBarBubbleViews( 75 bubble_ = new ToolbarActionsBarBubbleViews(
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } else { 416 } else {
416 EXPECT_TRUE(gfx::test::AreImagesEqual( 417 EXPECT_TRUE(gfx::test::AreImagesEqual(
417 gfx::Image(static_cast<const views::ImageView*>(v)->GetImage()), 418 gfx::Image(static_cast<const views::ImageView*>(v)->GetImage()),
418 gfx::Image(gfx::CreateVectorIcon(ui::kBusinessIcon, kIconSize, 419 gfx::Image(gfx::CreateVectorIcon(ui::kBusinessIcon, kIconSize,
419 gfx::kChromeIconGrey)))); 420 gfx::kChromeIconGrey))));
420 } 421 }
421 } 422 }
422 423
423 CloseBubble(); 424 CloseBubble();
424 } 425 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698