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

Side by Side Diff: components/exo/shell_surface_unittest.cc

Issue 2778733004: Add WindowPinType property on arua::Window (Closed)
Patch Set: WIP Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 #include "ash/common/accessibility_delegate.h" 6 #include "ash/common/accessibility_delegate.h"
7 #include "ash/common/wm/window_state.h" 7 #include "ash/common/wm/window_state.h"
8 #include "ash/common/wm/wm_event.h" 8 #include "ash/common/wm/wm_event.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 10 #include "ash/common/wm_window.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 TEST_F(ShellSurfaceTest, SetPinned) { 182 TEST_F(ShellSurfaceTest, SetPinned) {
183 gfx::Size buffer_size(256, 256); 183 gfx::Size buffer_size(256, 256);
184 std::unique_ptr<Buffer> buffer( 184 std::unique_ptr<Buffer> buffer(
185 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); 185 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
186 std::unique_ptr<Surface> surface(new Surface); 186 std::unique_ptr<Surface> surface(new Surface);
187 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 187 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
188 188
189 shell_surface->SetPinned(true, /* trusted */ true); 189 shell_surface->SetPinned(true, /* trusted */ true);
190 EXPECT_TRUE( 190 EXPECT_TRUE(shell_surface->GetWidget()->IsPinned());
191 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow())
192 ->IsPinned());
193 191
194 shell_surface->SetPinned(false, /* trusted */ true); 192 shell_surface->SetPinned(false, /* trusted */ true);
195 EXPECT_FALSE( 193 EXPECT_FALSE(shell_surface->GetWidget()->IsPinned());
196 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow())
197 ->IsPinned());
198 194
199 shell_surface->SetPinned(true, /* trusted */ false); 195 shell_surface->SetPinned(true, /* trusted */ false);
200 EXPECT_TRUE( 196 EXPECT_TRUE(shell_surface->GetWidget()->IsPinned());
201 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow())
202 ->IsPinned());
203 197
204 shell_surface->SetPinned(false, /* trusted */ false); 198 shell_surface->SetPinned(false, /* trusted */ false);
205 EXPECT_FALSE( 199 EXPECT_FALSE(shell_surface->GetWidget()->IsPinned());
206 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow())
207 ->IsPinned());
208 } 200 }
209 201
210 TEST_F(ShellSurfaceTest, SetTitle) { 202 TEST_F(ShellSurfaceTest, SetTitle) {
211 std::unique_ptr<Surface> surface(new Surface); 203 std::unique_ptr<Surface> surface(new Surface);
212 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 204 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
213 205
214 shell_surface->SetTitle(base::string16(base::ASCIIToUTF16("test"))); 206 shell_surface->SetTitle(base::string16(base::ASCIIToUTF16("test")));
215 surface->Commit(); 207 surface->Commit();
216 } 208 }
217 209
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 shell_surface.OnAccessibilityModeChanged(); 979 shell_surface.OnAccessibilityModeChanged();
988 shell_surface2.OnAccessibilityModeChanged(); 980 shell_surface2.OnAccessibilityModeChanged();
989 981
990 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 982 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
991 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 983 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
992 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); 984 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
993 } 985 }
994 986
995 } // namespace 987 } // namespace
996 } // namespace exo 988 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698