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

Side by Side Diff: ui/views/widget/widget_unittest.cc

Issue 2489513003: Fixes and test updates for aura-mus (Closed)
Patch Set: feedback Created 4 years, 1 month 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 | « ui/views/touchui/touch_selection_menu_runner_views_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 5 #include <algorithm>
6 #include <memory> 6 #include <memory>
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 EXPECT_EQ(child2, widget_hidden()); 840 EXPECT_EQ(child2, widget_hidden());
841 841
842 child1->Show(); 842 child1->Show();
843 EXPECT_EQ(child1, widget_shown()); 843 EXPECT_EQ(child1, widget_shown());
844 844
845 child2->Show(); 845 child2->Show();
846 EXPECT_EQ(child2, widget_shown()); 846 EXPECT_EQ(child2, widget_shown());
847 } 847 }
848 848
849 TEST_F(WidgetObserverTest, DestroyBubble) { 849 TEST_F(WidgetObserverTest, DestroyBubble) {
850 // This test expect NativeWidgetAura, force its creation.
851 ViewsDelegate::GetInstance()->set_native_widget_factory(
852 ViewsDelegate::NativeWidgetFactory());
853
850 WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget()); 854 WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget());
851 anchor->Show(); 855 anchor->Show();
852 856
853 BubbleDialogDelegateView* bubble_delegate = 857 BubbleDialogDelegateView* bubble_delegate =
854 new TestBubbleDialogDelegateView(anchor->client_view()); 858 new TestBubbleDialogDelegateView(anchor->client_view());
855 { 859 {
856 WidgetAutoclosePtr bubble_widget( 860 WidgetAutoclosePtr bubble_widget(
857 BubbleDialogDelegateView::CreateBubble(bubble_delegate)); 861 BubbleDialogDelegateView::CreateBubble(bubble_delegate));
858 bubble_widget->Show(); 862 bubble_widget->Show();
859 } 863 }
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 EXPECT_FALSE(contents_view->HasFocus()); 1268 EXPECT_FALSE(contents_view->HasFocus());
1265 EXPECT_TRUE(bubble_delegate_view->HasFocus()); 1269 EXPECT_TRUE(bubble_delegate_view->HasFocus());
1266 1270
1267 bubble_delegate_view->GetWidget()->CloseNow(); 1271 bubble_delegate_view->GetWidget()->CloseNow();
1268 1272
1269 // Closing the bubble should result in focus going back to the contents view. 1273 // Closing the bubble should result in focus going back to the contents view.
1270 EXPECT_TRUE(contents_view->HasFocus()); 1274 EXPECT_TRUE(contents_view->HasFocus());
1271 } 1275 }
1272 1276
1273 TEST_F(WidgetTest, BubbleControlsResetOnInit) { 1277 TEST_F(WidgetTest, BubbleControlsResetOnInit) {
1278 // This test creates a NativeWidgetAura and then a bubble parented to it. This
1279 // means the test needs a NativeWidgetAura for the bubble as well.
1280 ViewsDelegate::GetInstance()->set_native_widget_factory(
1281 ViewsDelegate::NativeWidgetFactory());
1282
1274 WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget()); 1283 WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget());
1275 anchor->Show(); 1284 anchor->Show();
1276 1285
1277 { 1286 {
1278 TestBubbleDialogDelegateView* bubble_delegate = 1287 TestBubbleDialogDelegateView* bubble_delegate =
1279 new TestBubbleDialogDelegateView(anchor->client_view()); 1288 new TestBubbleDialogDelegateView(anchor->client_view());
1280 WidgetAutoclosePtr bubble_widget( 1289 WidgetAutoclosePtr bubble_widget(
1281 BubbleDialogDelegateView::CreateBubble(bubble_delegate)); 1290 BubbleDialogDelegateView::CreateBubble(bubble_delegate));
1282 EXPECT_TRUE(bubble_delegate->reset_controls_called_); 1291 EXPECT_TRUE(bubble_delegate->reset_controls_called_);
1283 bubble_widget->Show(); 1292 bubble_widget->Show();
(...skipping 2564 matching lines...) Expand 10 before | Expand all | Expand 10 after
3848 Transparency_DesktopWidgetTranslucent 3857 Transparency_DesktopWidgetTranslucent
3849 #endif 3858 #endif
3850 TEST_F(CompositingWidgetTest, MAYBE_Transparency_DesktopWidgetTranslucent) { 3859 TEST_F(CompositingWidgetTest, MAYBE_Transparency_DesktopWidgetTranslucent) {
3851 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW); 3860 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW);
3852 } 3861 }
3853 3862
3854 #endif // !defined(OS_CHROMEOS) 3863 #endif // !defined(OS_CHROMEOS)
3855 3864
3856 } // namespace test 3865 } // namespace test
3857 } // namespace views 3866 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/touchui/touch_selection_menu_runner_views_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698