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

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

Issue 2706543002: exo: Synchronize multi-display window positioning (Closed)
Patch Set: Fix shadow and address comments 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 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 "ash/common/accessibility_delegate.h" 5 #include "ash/common/accessibility_delegate.h"
6 #include "ash/common/wm/window_state.h" 6 #include "ash/common/wm/window_state.h"
7 #include "ash/common/wm/wm_event.h" 7 #include "ash/common/wm/wm_event.h"
8 #include "ash/common/wm_shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "ash/common/wm_window.h" 9 #include "ash/common/wm_window.h"
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
(...skipping 23 matching lines...) Expand all
34 34
35 namespace exo { 35 namespace exo {
36 namespace { 36 namespace {
37 37
38 using ShellSurfaceTest = test::ExoTestBase; 38 using ShellSurfaceTest = test::ExoTestBase;
39 39
40 uint32_t ConfigureFullscreen(uint32_t serial, 40 uint32_t ConfigureFullscreen(uint32_t serial,
41 const gfx::Size& size, 41 const gfx::Size& size,
42 ash::wm::WindowStateType state_type, 42 ash::wm::WindowStateType state_type,
43 bool resizing, 43 bool resizing,
44 bool activated) { 44 bool activated,
45 const gfx::Point& origin) {
45 EXPECT_EQ(ash::wm::WINDOW_STATE_TYPE_FULLSCREEN, state_type); 46 EXPECT_EQ(ash::wm::WINDOW_STATE_TYPE_FULLSCREEN, state_type);
46 return serial; 47 return serial;
47 } 48 }
48 49
49 wm::ShadowElevation GetShadowElevation(aura::Window* window) { 50 wm::ShadowElevation GetShadowElevation(aura::Window* window) {
50 return window->GetProperty(wm::kShadowElevationKey); 51 return window->GetProperty(wm::kShadowElevationKey);
51 } 52 }
52 53
53 TEST_F(ShellSurfaceTest, AcknowledgeConfigure) { 54 TEST_F(ShellSurfaceTest, AcknowledgeConfigure) {
54 gfx::Size buffer_size(32, 32); 55 gfx::Size buffer_size(32, 32);
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 EXPECT_FALSE(shell_surface.get()); 361 EXPECT_FALSE(shell_surface.get());
361 } 362 }
362 363
363 uint32_t Configure(gfx::Size* suggested_size, 364 uint32_t Configure(gfx::Size* suggested_size,
364 ash::wm::WindowStateType* has_state_type, 365 ash::wm::WindowStateType* has_state_type,
365 bool* is_resizing, 366 bool* is_resizing,
366 bool* is_active, 367 bool* is_active,
367 const gfx::Size& size, 368 const gfx::Size& size,
368 ash::wm::WindowStateType state_type, 369 ash::wm::WindowStateType state_type,
369 bool resizing, 370 bool resizing,
370 bool activated) { 371 bool activated,
372 const gfx::Point& origin) {
371 *suggested_size = size; 373 *suggested_size = size;
372 *has_state_type = state_type; 374 *has_state_type = state_type;
373 *is_resizing = resizing; 375 *is_resizing = resizing;
374 *is_active = activated; 376 *is_active = activated;
375 return 0; 377 return 0;
376 } 378 }
377 379
378 TEST_F(ShellSurfaceTest, ConfigureCallback) { 380 TEST_F(ShellSurfaceTest, ConfigureCallback) {
379 std::unique_ptr<Surface> surface(new Surface); 381 std::unique_ptr<Surface> surface(new Surface);
380 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 382 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 shell_surface.OnAccessibilityModeChanged(); 943 shell_surface.OnAccessibilityModeChanged();
942 shell_surface2.OnAccessibilityModeChanged(); 944 shell_surface2.OnAccessibilityModeChanged();
943 945
944 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 946 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
945 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 947 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
946 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); 948 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
947 } 949 }
948 950
949 } // namespace 951 } // namespace
950 } // namespace exo 952 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698