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

Unified Diff: ui/views/mus/desktop_window_tree_host_mus_unittest.cc

Issue 2694213003: mash: wires up shadows for mash (Closed)
Patch Set: defaults test Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.cc ('k') | ui/views/mus/mus_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/desktop_window_tree_host_mus_unittest.cc
diff --git a/ui/views/mus/desktop_window_tree_host_mus_unittest.cc b/ui/views/mus/desktop_window_tree_host_mus_unittest.cc
index 4c72bb57e38d7336851c0773601d48488a47bf17..247c0e438f518d0594b0b09785aa0244a3ec653c 100644
--- a/ui/views/mus/desktop_window_tree_host_mus_unittest.cc
+++ b/ui/views/mus/desktop_window_tree_host_mus_unittest.cc
@@ -22,6 +22,7 @@
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/widget/widget_observer.h"
+#include "ui/wm/core/shadow_types.h"
namespace views {
@@ -295,4 +296,32 @@ TEST_F(DesktopWindowTreeHostMusTest, TransientParentWiredToHostWindow) {
widget2->GetNativeView()->GetHost()->window()));
}
+TEST_F(DesktopWindowTreeHostMusTest, ShadowDefaults) {
+ Widget widget;
+ Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
+ params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ widget.Init(params);
+ // |DesktopNativeWidgetAura::content_window_| should have no shadow; the wm
+ // should provide it if it so desires.
+ EXPECT_EQ(wm::ShadowElevation::NONE,
+ widget.GetNativeView()->GetProperty(wm::kShadowElevationKey));
+ // The wm honors the shadow property from the WindowTreeHost's window.
+ EXPECT_EQ(wm::ShadowElevation::DEFAULT,
+ widget.GetNativeView()->GetHost()->window()->GetProperty(
+ wm::kShadowElevationKey));
+}
+
+TEST_F(DesktopWindowTreeHostMusTest, NoShadow) {
+ Widget widget;
+ Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
+ params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ params.shadow_type = Widget::InitParams::SHADOW_TYPE_NONE;
+ widget.Init(params);
+ EXPECT_EQ(wm::ShadowElevation::NONE,
+ widget.GetNativeView()->GetProperty(wm::kShadowElevationKey));
+ EXPECT_EQ(wm::ShadowElevation::NONE,
+ widget.GetNativeView()->GetHost()->window()->GetProperty(
+ wm::kShadowElevationKey));
+}
+
} // namespace views
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.cc ('k') | ui/views/mus/mus_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698