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

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

Issue 2549503002: Rename PlatformScreen to ScreenManager. (Closed)
Patch Set: Rebase. 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 | « services/ui/service.cc ('k') | services/ui/ws/display_manager.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"
(...skipping 30 matching lines...) Expand all
41 41
42 WindowServer* window_server() { return ws_test_helper_.window_server(); } 42 WindowServer* window_server() { return ws_test_helper_.window_server(); }
43 TestWindowServerDelegate* window_server_delegate() { 43 TestWindowServerDelegate* window_server_delegate() {
44 return ws_test_helper_.window_server_delegate(); 44 return ws_test_helper_.window_server_delegate();
45 } 45 }
46 mojom::Cursor cursor() const { return ws_test_helper_.cursor(); } 46 mojom::Cursor cursor() const { return ws_test_helper_.cursor(); }
47 47
48 protected: 48 protected:
49 // testing::Test: 49 // testing::Test:
50 void SetUp() override { 50 void SetUp() override {
51 platform_screen_.Init(window_server()->display_manager()); 51 screen_manager_.Init(window_server()->display_manager());
52 platform_screen_.AddDisplay(); 52 screen_manager_.AddDisplay();
53 53
54 // As a side effect, this allocates Displays. 54 // As a side effect, this allocates Displays.
55 AddWindowManager(window_server(), kTestId1); 55 AddWindowManager(window_server(), kTestId1);
56 window_server()->user_id_tracker()->AddUserId(kTestId1); 56 window_server()->user_id_tracker()->AddUserId(kTestId1);
57 window_server()->user_id_tracker()->SetActiveUserId(kTestId1); 57 window_server()->user_id_tracker()->SetActiveUserId(kTestId1);
58 } 58 }
59 59
60 ServerWindow* GetRoot() { 60 ServerWindow* GetRoot() {
61 DisplayManager* display_manager = window_server()->display_manager(); 61 DisplayManager* display_manager = window_server()->display_manager();
62 // ASSERT_EQ(1u, display_manager->displays().size()); 62 // ASSERT_EQ(1u, display_manager->displays().size());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 display->GetActiveWindowManagerDisplayRoot(); 96 display->GetActiveWindowManagerDisplayRoot();
97 ASSERT_TRUE(active_display_root); 97 ASSERT_TRUE(active_display_root);
98 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(ui::PointerEvent( 98 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(ui::PointerEvent(
99 ui::MouseEvent(ui::ET_MOUSE_MOVED, p, p, base::TimeTicks(), 0, 0))); 99 ui::MouseEvent(ui::ET_MOUSE_MOVED, p, p, base::TimeTicks(), 0, 0)));
100 WindowManagerState* wms = active_display_root->window_manager_state(); 100 WindowManagerState* wms = active_display_root->window_manager_state();
101 wms->OnEventAck(wms->window_tree(), mojom::EventResult::HANDLED); 101 wms->OnEventAck(wms->window_tree(), mojom::EventResult::HANDLED);
102 } 102 }
103 103
104 private: 104 private:
105 WindowServerTestHelper ws_test_helper_; 105 WindowServerTestHelper ws_test_helper_;
106 TestPlatformScreen platform_screen_; 106 TestScreenManager screen_manager_;
107 DISALLOW_COPY_AND_ASSIGN(CursorTest); 107 DISALLOW_COPY_AND_ASSIGN(CursorTest);
108 }; 108 };
109 109
110 TEST_F(CursorTest, ChangeByMouseMove) { 110 TEST_F(CursorTest, ChangeByMouseMove) {
111 ServerWindow* win = BuildServerWindow(); 111 ServerWindow* win = BuildServerWindow();
112 win->SetPredefinedCursor(mojom::Cursor::IBEAM); 112 win->SetPredefinedCursor(mojom::Cursor::IBEAM);
113 EXPECT_EQ(mojom::Cursor::IBEAM, win->cursor()); 113 EXPECT_EQ(mojom::Cursor::IBEAM, win->cursor());
114 win->SetNonClientCursor(mojom::Cursor::EAST_RESIZE); 114 win->SetNonClientCursor(mojom::Cursor::EAST_RESIZE);
115 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, win->non_client_cursor()); 115 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, win->non_client_cursor());
116 116
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 MoveCursorTo(gfx::Point(15, 15)); 178 MoveCursorTo(gfx::Point(15, 15));
179 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, cursor()); 179 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, cursor());
180 180
181 win->SetBounds(gfx::Rect(0, 0, 30, 30)); 181 win->SetBounds(gfx::Rect(0, 0, 30, 30));
182 EXPECT_EQ(mojom::Cursor::IBEAM, cursor()); 182 EXPECT_EQ(mojom::Cursor::IBEAM, cursor());
183 } 183 }
184 184
185 } // namespace test 185 } // namespace test
186 } // namespace ws 186 } // namespace ws
187 } // namespace ui 187 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/service.cc ('k') | services/ui/ws/display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698