| OLD | NEW |
| 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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 EXPECT_EQ(child2, widget_hidden()); | 850 EXPECT_EQ(child2, widget_hidden()); |
| 851 | 851 |
| 852 child1->Show(); | 852 child1->Show(); |
| 853 EXPECT_EQ(child1, widget_shown()); | 853 EXPECT_EQ(child1, widget_shown()); |
| 854 | 854 |
| 855 child2->Show(); | 855 child2->Show(); |
| 856 EXPECT_EQ(child2, widget_shown()); | 856 EXPECT_EQ(child2, widget_shown()); |
| 857 } | 857 } |
| 858 | 858 |
| 859 TEST_F(WidgetObserverTest, DestroyBubble) { | 859 TEST_F(WidgetObserverTest, DestroyBubble) { |
| 860 // TODO: reenable once http://crbug.com/663903 is fixed. | |
| 861 if (IsAuraMusClient()) | |
| 862 return; | |
| 863 | |
| 864 // This test expect NativeWidgetAura, force its creation. | 860 // This test expect NativeWidgetAura, force its creation. |
| 865 ViewsDelegate::GetInstance()->set_native_widget_factory( | 861 ViewsDelegate::GetInstance()->set_native_widget_factory( |
| 866 ViewsDelegate::NativeWidgetFactory()); | 862 ViewsDelegate::NativeWidgetFactory()); |
| 867 | 863 |
| 868 WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget()); | 864 WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget()); |
| 869 anchor->Show(); | 865 anchor->Show(); |
| 870 | 866 |
| 871 BubbleDialogDelegateView* bubble_delegate = | 867 BubbleDialogDelegateView* bubble_delegate = |
| 872 new TestBubbleDialogDelegateView(anchor->client_view()); | 868 new TestBubbleDialogDelegateView(anchor->client_view()); |
| 873 { | 869 { |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 EXPECT_FALSE(contents_view->HasFocus()); | 1278 EXPECT_FALSE(contents_view->HasFocus()); |
| 1283 EXPECT_TRUE(bubble_delegate_view->HasFocus()); | 1279 EXPECT_TRUE(bubble_delegate_view->HasFocus()); |
| 1284 | 1280 |
| 1285 bubble_delegate_view->GetWidget()->CloseNow(); | 1281 bubble_delegate_view->GetWidget()->CloseNow(); |
| 1286 | 1282 |
| 1287 // Closing the bubble should result in focus going back to the contents view. | 1283 // Closing the bubble should result in focus going back to the contents view. |
| 1288 EXPECT_TRUE(contents_view->HasFocus()); | 1284 EXPECT_TRUE(contents_view->HasFocus()); |
| 1289 } | 1285 } |
| 1290 | 1286 |
| 1291 TEST_F(WidgetTest, BubbleControlsResetOnInit) { | 1287 TEST_F(WidgetTest, BubbleControlsResetOnInit) { |
| 1292 // TODO: enable once http://crbug.com/660994 is fixed. | |
| 1293 if (IsAuraMusClient()) | |
| 1294 return; | |
| 1295 | |
| 1296 WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget()); | 1288 WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget()); |
| 1297 anchor->Show(); | 1289 anchor->Show(); |
| 1298 | 1290 |
| 1299 { | 1291 { |
| 1300 TestBubbleDialogDelegateView* bubble_delegate = | 1292 TestBubbleDialogDelegateView* bubble_delegate = |
| 1301 new TestBubbleDialogDelegateView(anchor->client_view()); | 1293 new TestBubbleDialogDelegateView(anchor->client_view()); |
| 1302 WidgetAutoclosePtr bubble_widget( | 1294 WidgetAutoclosePtr bubble_widget( |
| 1303 BubbleDialogDelegateView::CreateBubble(bubble_delegate)); | 1295 BubbleDialogDelegateView::CreateBubble(bubble_delegate)); |
| 1304 EXPECT_TRUE(bubble_delegate->reset_controls_called_); | 1296 EXPECT_TRUE(bubble_delegate->reset_controls_called_); |
| 1305 bubble_widget->Show(); | 1297 bubble_widget->Show(); |
| (...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3912 } | 3904 } |
| 3913 | 3905 |
| 3914 TEST_F(CompositingWidgetTest, Transparency_DesktopWidgetTranslucent) { | 3906 TEST_F(CompositingWidgetTest, Transparency_DesktopWidgetTranslucent) { |
| 3915 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW); | 3907 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW); |
| 3916 } | 3908 } |
| 3917 | 3909 |
| 3918 #endif // !defined(OS_CHROMEOS) | 3910 #endif // !defined(OS_CHROMEOS) |
| 3919 | 3911 |
| 3920 } // namespace test | 3912 } // namespace test |
| 3921 } // namespace views | 3913 } // namespace views |
| OLD | NEW |