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

Side by Side Diff: services/ui/ws/cursor_unittest.cc

Issue 2429173005: Mus+Ash: Replace (Server)WindowSurface with (Server)WindowCompositorFrameSink (Closed)
Patch Set: Rebased Created 4 years, 2 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
« no previous file with comments | « services/ui/ws/access_policy.h ('k') | services/ui/ws/default_access_policy.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "services/ui/common/types.h" 11 #include "services/ui/common/types.h"
12 #include "services/ui/common/util.h" 12 #include "services/ui/common/util.h"
13 #include "services/ui/public/interfaces/window_tree.mojom.h" 13 #include "services/ui/public/interfaces/window_tree.mojom.h"
14 #include "services/ui/surfaces/display_compositor.h" 14 #include "services/ui/surfaces/display_compositor.h"
15 #include "services/ui/ws/display_manager.h" 15 #include "services/ui/ws/display_manager.h"
16 #include "services/ui/ws/ids.h" 16 #include "services/ui/ws/ids.h"
17 #include "services/ui/ws/platform_display.h" 17 #include "services/ui/ws/platform_display.h"
18 #include "services/ui/ws/platform_display_factory.h" 18 #include "services/ui/ws/platform_display_factory.h"
19 #include "services/ui/ws/server_window.h" 19 #include "services/ui/ws/server_window.h"
20 #include "services/ui/ws/server_window_surface_manager_test_api.h" 20 #include "services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h"
21 #include "services/ui/ws/test_utils.h" 21 #include "services/ui/ws/test_utils.h"
22 #include "services/ui/ws/window_manager_display_root.h" 22 #include "services/ui/ws/window_manager_display_root.h"
23 #include "services/ui/ws/window_manager_state.h" 23 #include "services/ui/ws/window_manager_state.h"
24 #include "services/ui/ws/window_server.h" 24 #include "services/ui/ws/window_server.h"
25 #include "services/ui/ws/window_server_delegate.h" 25 #include "services/ui/ws/window_server_delegate.h"
26 #include "services/ui/ws/window_tree.h" 26 #include "services/ui/ws/window_tree.h"
27 #include "services/ui/ws/window_tree_binding.h" 27 #include "services/ui/ws/window_tree_binding.h"
28 #include "testing/gtest/include/gtest/gtest.h" 28 #include "testing/gtest/include/gtest/gtest.h"
29 #include "ui/events/event.h" 29 #include "ui/events/event.h"
30 #include "ui/gfx/geometry/rect.h" 30 #include "ui/gfx/geometry/rect.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 active_display_root->window_manager_state()->window_tree(); 76 active_display_root->window_manager_state()->window_tree();
77 ClientWindowId child_window_id; 77 ClientWindowId child_window_id;
78 if (!NewWindowInTree(tree, &child_window_id)) 78 if (!NewWindowInTree(tree, &child_window_id))
79 return nullptr; 79 return nullptr;
80 80
81 ServerWindow* w = tree->GetWindowByClientId(child_window_id); 81 ServerWindow* w = tree->GetWindowByClientId(child_window_id);
82 w->SetBounds(gfx::Rect(10, 10, 30, 30)); 82 w->SetBounds(gfx::Rect(10, 10, 30, 30));
83 w->SetClientArea(gfx::Insets(10, 10), std::vector<gfx::Rect>()); 83 w->SetClientArea(gfx::Insets(10, 10), std::vector<gfx::Rect>());
84 w->SetVisible(true); 84 w->SetVisible(true);
85 85
86 ServerWindowSurfaceManagerTestApi test_api(w->GetOrCreateSurfaceManager()); 86 ServerWindowCompositorFrameSinkManagerTestApi test_api(
87 test_api.CreateEmptyDefaultSurface(); 87 w->GetOrCreateCompositorFrameSinkManager());
88 test_api.CreateEmptyDefaultCompositorFrameSink();
88 89
89 return w; 90 return w;
90 } 91 }
91 92
92 void MoveCursorTo(const gfx::Point& p) { 93 void MoveCursorTo(const gfx::Point& p) {
93 DisplayManager* display_manager = window_server()->display_manager(); 94 DisplayManager* display_manager = window_server()->display_manager();
94 ASSERT_EQ(1u, display_manager->displays().size()); 95 ASSERT_EQ(1u, display_manager->displays().size());
95 Display* display = *display_manager->displays().begin(); 96 Display* display = *display_manager->displays().begin();
96 WindowManagerDisplayRoot* active_display_root = 97 WindowManagerDisplayRoot* active_display_root =
97 display->GetActiveWindowManagerDisplayRoot(); 98 display->GetActiveWindowManagerDisplayRoot();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 MoveCursorTo(gfx::Point(15, 15)); 179 MoveCursorTo(gfx::Point(15, 15));
179 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, cursor()); 180 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, cursor());
180 181
181 win->SetBounds(gfx::Rect(0, 0, 30, 30)); 182 win->SetBounds(gfx::Rect(0, 0, 30, 30));
182 EXPECT_EQ(mojom::Cursor::IBEAM, cursor()); 183 EXPECT_EQ(mojom::Cursor::IBEAM, cursor());
183 } 184 }
184 185
185 } // namespace test 186 } // namespace test
186 } // namespace ws 187 } // namespace ws
187 } // namespace ui 188 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/access_policy.h ('k') | services/ui/ws/default_access_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698