| Index: ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
|
| diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
|
| index 872cd30c086b32529ee05733cede200bc1dcdebb..0e8bd99e750b070b06f5c24b6c5cf0d1f39c51a1 100644
|
| --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
|
| +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
|
| @@ -12,6 +12,7 @@
|
| #include "build/build_config.h"
|
| #include "ui/aura/client/aura_constants.h"
|
| #include "ui/aura/client/cursor_client.h"
|
| +#include "ui/aura/client/focus_client.h"
|
| #include "ui/aura/client/window_parenting_client.h"
|
| #include "ui/aura/test/test_window_delegate.h"
|
| #include "ui/aura/window.h"
|
| @@ -103,6 +104,21 @@ TEST_F(DesktopNativeWidgetAuraTest, NativeViewInitiallyHidden) {
|
| EXPECT_FALSE(widget.GetNativeView()->IsVisible());
|
| }
|
|
|
| +// Verifies that the native view isn't activated if Widget requires that.
|
| +TEST_F(DesktopNativeWidgetAuraTest, NativeViewNoActivate) {
|
| + // Widget of TYPE_POPUP can't be activated.
|
| + Widget widget;
|
| + Widget::InitParams init_params = CreateParams(Widget::InitParams::TYPE_POPUP);
|
| + init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
|
| + DesktopNativeWidgetAura* widget_aura = new DesktopNativeWidgetAura(&widget);
|
| + init_params.native_widget = widget_aura;
|
| + widget.Init(init_params);
|
| +
|
| + EXPECT_FALSE(widget.CanActivate());
|
| + EXPECT_EQ(nullptr, aura::client::GetFocusClient(widget_aura->content_window())
|
| + ->GetFocusedWindow());
|
| +}
|
| +
|
| // Verifies that if the DesktopWindowTreeHost is already shown, the native view
|
| // still reports not visible as we haven't shown the content window.
|
| TEST_F(DesktopNativeWidgetAuraTest, WidgetNotVisibleOnlyWindowTreeHostShown) {
|
|
|