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

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

Issue 2645663004: exo: Initial support for multiple displays in ARC (Closed)
Patch Set: Rebase 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 TEST_F(ShellSurfaceTest, AcknowledgeConfigure) { 50 TEST_F(ShellSurfaceTest, AcknowledgeConfigure) {
50 gfx::Size buffer_size(32, 32); 51 gfx::Size buffer_size(32, 32);
51 std::unique_ptr<Buffer> buffer( 52 std::unique_ptr<Buffer> buffer(
52 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); 53 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
53 std::unique_ptr<Surface> surface(new Surface); 54 std::unique_ptr<Surface> surface(new Surface);
54 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 55 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 EXPECT_FALSE(shell_surface.get()); 357 EXPECT_FALSE(shell_surface.get());
357 } 358 }
358 359
359 uint32_t Configure(gfx::Size* suggested_size, 360 uint32_t Configure(gfx::Size* suggested_size,
360 ash::wm::WindowStateType* has_state_type, 361 ash::wm::WindowStateType* has_state_type,
361 bool* is_resizing, 362 bool* is_resizing,
362 bool* is_active, 363 bool* is_active,
363 const gfx::Size& size, 364 const gfx::Size& size,
364 ash::wm::WindowStateType state_type, 365 ash::wm::WindowStateType state_type,
365 bool resizing, 366 bool resizing,
366 bool activated) { 367 bool activated,
368 const gfx::Point& origin) {
367 *suggested_size = size; 369 *suggested_size = size;
368 *has_state_type = state_type; 370 *has_state_type = state_type;
369 *is_resizing = resizing; 371 *is_resizing = resizing;
370 *is_active = activated; 372 *is_active = activated;
371 return 0; 373 return 0;
372 } 374 }
373 375
374 TEST_F(ShellSurfaceTest, ConfigureCallback) { 376 TEST_F(ShellSurfaceTest, ConfigureCallback) {
375 std::unique_ptr<Surface> surface(new Surface); 377 std::unique_ptr<Surface> surface(new Surface);
376 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 378 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 shell_surface.OnAccessibilityModeChanged(); 939 shell_surface.OnAccessibilityModeChanged();
938 shell_surface2.OnAccessibilityModeChanged(); 940 shell_surface2.OnAccessibilityModeChanged();
939 941
940 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 942 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
941 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 943 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
942 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); 944 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
943 } 945 }
944 946
945 } // namespace 947 } // namespace
946 } // namespace exo 948 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698