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

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

Issue 2548653005: exo: Add initial support for service side decorations. (Closed)
Patch Set: fix typo Created 4 years 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
« no previous file with comments | « components/exo/display.cc ('k') | components/exo/shell_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/aura/wm_window_aura.h" 5 #include "ash/aura/wm_window_aura.h"
6 #include "ash/common/wm/window_positioning_utils.h" 6 #include "ash/common/wm/window_positioning_utils.h"
7 #include "ash/common/wm_shell.h" 7 #include "ash/common/wm_shell.h"
8 #include "ash/public/cpp/shell_window_ids.h" 8 #include "ash/public/cpp/shell_window_ids.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "components/exo/buffer.h" 10 #include "components/exo/buffer.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 EXPECT_CALL(delegate, OnPointerEnter(sub_surface.get(), gfx::PointF(), 0)); 169 EXPECT_CALL(delegate, OnPointerEnter(sub_surface.get(), gfx::PointF(), 0));
170 generator.MoveMouseTo(sub_surface->window()->GetBoundsInScreen().origin()); 170 generator.MoveMouseTo(sub_surface->window()->GetBoundsInScreen().origin());
171 171
172 EXPECT_CALL(delegate, OnPointerMotion(testing::_, gfx::PointF(1, 1))); 172 EXPECT_CALL(delegate, OnPointerMotion(testing::_, gfx::PointF(1, 1)));
173 generator.MoveMouseTo(sub_surface->window()->GetBoundsInScreen().origin() + 173 generator.MoveMouseTo(sub_surface->window()->GetBoundsInScreen().origin() +
174 gfx::Vector2d(1, 1)); 174 gfx::Vector2d(1, 1));
175 175
176 std::unique_ptr<Surface> child_surface(new Surface); 176 std::unique_ptr<Surface> child_surface(new Surface);
177 std::unique_ptr<ShellSurface> child_shell_surface(new ShellSurface( 177 std::unique_ptr<ShellSurface> child_shell_surface(new ShellSurface(
178 child_surface.get(), shell_surface.get(), gfx::Rect(9, 9, 1, 1), true, 178 child_surface.get(), shell_surface.get(), gfx::Rect(9, 9, 1, 1), true,
179 ash::kShellWindowId_DefaultContainer)); 179 false, ash::kShellWindowId_DefaultContainer));
180 gfx::Size child_buffer_size(15, 15); 180 gfx::Size child_buffer_size(15, 15);
181 std::unique_ptr<Buffer> child_buffer( 181 std::unique_ptr<Buffer> child_buffer(
182 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(child_buffer_size))); 182 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(child_buffer_size)));
183 child_surface->Attach(child_buffer.get()); 183 child_surface->Attach(child_buffer.get());
184 child_surface->Commit(); 184 child_surface->Commit();
185 185
186 EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(child_surface.get())) 186 EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(child_surface.get()))
187 .WillRepeatedly(testing::Return(true)); 187 .WillRepeatedly(testing::Return(true));
188 188
189 EXPECT_CALL(delegate, OnPointerLeave(sub_surface.get())); 189 EXPECT_CALL(delegate, OnPointerLeave(sub_surface.get()));
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 gfx::Point location = surface->window()->GetBoundsInScreen().origin(); 302 gfx::Point location = surface->window()->GetBoundsInScreen().origin();
303 303
304 MockPointerDelegate delegate; 304 MockPointerDelegate delegate;
305 std::unique_ptr<Pointer> pointer(new Pointer(&delegate)); 305 std::unique_ptr<Pointer> pointer(new Pointer(&delegate));
306 ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow()); 306 ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
307 307
308 // Create surface for modal window. 308 // Create surface for modal window.
309 std::unique_ptr<Surface> surface2(new Surface); 309 std::unique_ptr<Surface> surface2(new Surface);
310 std::unique_ptr<ShellSurface> shell_surface2( 310 std::unique_ptr<ShellSurface> shell_surface2(
311 new ShellSurface(surface2.get(), nullptr, gfx::Rect(0, 0, 5, 5), true, 311 new ShellSurface(surface2.get(), nullptr, gfx::Rect(0, 0, 5, 5), true,
312 ash::kShellWindowId_SystemModalContainer)); 312 false, ash::kShellWindowId_SystemModalContainer));
313 std::unique_ptr<Buffer> buffer2( 313 std::unique_ptr<Buffer> buffer2(
314 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(gfx::Size(5, 5)))); 314 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(gfx::Size(5, 5))));
315 surface2->Attach(buffer2.get()); 315 surface2->Attach(buffer2.get());
316 surface2->Commit(); 316 surface2->Commit();
317 ash::wm::CenterWindow(ash::WmWindowAura::Get(surface2->window())); 317 ash::wm::CenterWindow(ash::WmWindowAura::Get(surface2->window()));
318 gfx::Point location2 = surface2->window()->GetBoundsInScreen().origin(); 318 gfx::Point location2 = surface2->window()->GetBoundsInScreen().origin();
319 319
320 // Make the window modal. 320 // Make the window modal.
321 shell_surface2->SetSystemModal(true); 321 shell_surface2->SetSystemModal(true);
322 EXPECT_TRUE(ash::WmShell::Get()->IsSystemModalWindowOpen()); 322 EXPECT_TRUE(ash::WmShell::Get()->IsSystemModalWindowOpen());
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 EXPECT_CALL(delegate, OnPointerLeave(surface.get())); 445 EXPECT_CALL(delegate, OnPointerLeave(surface.get()));
446 } 446 }
447 generator.MoveMouseTo(surface->window()->GetBoundsInScreen().bottom_right()); 447 generator.MoveMouseTo(surface->window()->GetBoundsInScreen().bottom_right());
448 448
449 EXPECT_CALL(delegate, OnPointerDestroying(pointer.get())); 449 EXPECT_CALL(delegate, OnPointerDestroying(pointer.get()));
450 pointer.reset(); 450 pointer.reset();
451 } 451 }
452 452
453 } // namespace 453 } // namespace
454 } // namespace exo 454 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/display.cc ('k') | components/exo/shell_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698