Commit c1ad8f0a authored by xiyuan's avatar xiyuan Committed by Commit bot

mash: Fix create fullscreen widget

Set kShowStateKey property from init params show_state so that
mus window is created properly.

BUG=714804
TEST=DesktopWindowTreeHostMusTest.CreateFullscreenWidget

Review-Url: https://codereview.chromium.org/2840903002
Cr-Commit-Position: refs/heads/master@{#467572}
parent 2236c8e0
...@@ -283,6 +283,8 @@ void DesktopWindowTreeHostMus::Init(aura::Window* content_window, ...@@ -283,6 +283,8 @@ void DesktopWindowTreeHostMus::Init(aura::Window* content_window,
content_window->SetTransparent(transparent); content_window->SetTransparent(transparent);
window()->SetTransparent(transparent); window()->SetTransparent(transparent);
window()->SetProperty(aura::client::kShowStateKey, params.show_state);
if (!params.bounds.IsEmpty()) if (!params.bounds.IsEmpty())
SetBoundsInDIP(params.bounds); SetBoundsInDIP(params.bounds);
......
...@@ -327,4 +327,22 @@ TEST_F(DesktopWindowTreeHostMusTest, NoShadow) { ...@@ -327,4 +327,22 @@ TEST_F(DesktopWindowTreeHostMusTest, NoShadow) {
wm::kShadowElevationKey)); wm::kShadowElevationKey));
} }
TEST_F(DesktopWindowTreeHostMusTest, CreateFullscreenWidget) {
const Widget::InitParams::Type kWidgetTypes[] = {
Widget::InitParams::TYPE_WINDOW,
Widget::InitParams::TYPE_WINDOW_FRAMELESS,
};
for (auto widget_type : kWidgetTypes) {
Widget widget;
Widget::InitParams params(widget_type);
params.show_state = ui::SHOW_STATE_FULLSCREEN;
params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
widget.Init(params);
EXPECT_TRUE(widget.IsFullscreen())
<< "Fullscreen creation failed for type=" << widget_type;
}
}
} // namespace views } // namespace views
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment