Chromium Code Reviews| Index: components/exo/shell_surface_unittest.cc |
| diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc |
| index 8d2543fb7e3075490c223bec090590c27a332890..68507ff85d5f7e20a21406d38bd07843f6b84d06 100644 |
| --- a/components/exo/shell_surface_unittest.cc |
| +++ b/components/exo/shell_surface_unittest.cc |
| @@ -9,6 +9,7 @@ |
| #include "ash/common/wm_shell.h" |
| #include "ash/common/wm_window.h" |
| #include "ash/public/cpp/shell_window_ids.h" |
| +#include "ash/public/cpp/window_properties.h" |
| #include "ash/shell.h" |
| #include "ash/wm/window_state_aura.h" |
| #include "base/message_loop/message_loop.h" |
| @@ -52,6 +53,13 @@ wm::ShadowElevation GetShadowElevation(aura::Window* window) { |
| return window->GetProperty(wm::kShadowElevationKey); |
| } |
| +bool WidgetIsPinned(views::Widget* widget) { |
|
sky
2017/03/31 20:54:48
IsWidgetPinned.
Peng
2017/04/03 15:11:27
Done.
|
| + ash::WindowPinType type = |
| + widget->GetNativeWindow()->GetProperty(ash::kWindowPinTypeKey); |
| + return type == ash::WindowPinType::PINNED || |
| + type == ash::WindowPinType::TRUSTED_PINNED; |
| +} |
| + |
| TEST_F(ShellSurfaceTest, AcknowledgeConfigure) { |
| gfx::Size buffer_size(32, 32); |
| std::unique_ptr<Buffer> buffer( |
| @@ -187,24 +195,16 @@ TEST_F(ShellSurfaceTest, SetPinned) { |
| std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| shell_surface->SetPinned(true, /* trusted */ true); |
| - EXPECT_TRUE( |
| - ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow()) |
| - ->IsPinned()); |
| + EXPECT_TRUE(WidgetIsPinned(shell_surface->GetWidget())); |
| shell_surface->SetPinned(false, /* trusted */ true); |
| - EXPECT_FALSE( |
| - ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow()) |
| - ->IsPinned()); |
| + EXPECT_FALSE(WidgetIsPinned(shell_surface->GetWidget())); |
| shell_surface->SetPinned(true, /* trusted */ false); |
| - EXPECT_TRUE( |
| - ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow()) |
| - ->IsPinned()); |
| + EXPECT_TRUE(WidgetIsPinned(shell_surface->GetWidget())); |
| shell_surface->SetPinned(false, /* trusted */ false); |
| - EXPECT_FALSE( |
| - ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow()) |
| - ->IsPinned()); |
| + EXPECT_FALSE(WidgetIsPinned(shell_surface->GetWidget())); |
| } |
| TEST_F(ShellSurfaceTest, SetSystemUiVisibility) { |