| OLD | NEW |
| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 class CursorTest : public testing::Test { | 38 class CursorTest : public testing::Test { |
| 39 public: | 39 public: |
| 40 CursorTest() : cursor_id_(-1), platform_display_factory_(&cursor_id_) {} | 40 CursorTest() : cursor_id_(-1), platform_display_factory_(&cursor_id_) {} |
| 41 ~CursorTest() override {} | 41 ~CursorTest() override {} |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 // testing::Test: | 44 // testing::Test: |
| 45 void SetUp() override { | 45 void SetUp() override { |
| 46 PlatformDisplay::set_factory_for_testing(&platform_display_factory_); | 46 PlatformDisplay::set_factory_for_testing(&platform_display_factory_); |
| 47 window_server_.reset( | 47 window_server_.reset(new WindowServer(&window_server_delegate_)); |
| 48 new WindowServer(&window_server_delegate_, | |
| 49 scoped_refptr<SurfacesState>(new SurfacesState))); | |
| 50 window_server_delegate_.set_window_server(window_server_.get()); | 48 window_server_delegate_.set_window_server(window_server_.get()); |
| 51 | 49 |
| 52 window_server_delegate_.set_num_displays_to_create(1); | 50 window_server_delegate_.set_num_displays_to_create(1); |
| 53 | 51 |
| 54 // As a side effect, this allocates Displays. | 52 // As a side effect, this allocates Displays. |
| 55 WindowManagerWindowTreeFactorySetTestApi( | 53 WindowManagerWindowTreeFactorySetTestApi( |
| 56 window_server_->window_manager_window_tree_factory_set()) | 54 window_server_->window_manager_window_tree_factory_set()) |
| 57 .Add(kTestId1); | 55 .Add(kTestId1); |
| 58 window_server_->user_id_tracker()->AddUserId(kTestId1); | 56 window_server_->user_id_tracker()->AddUserId(kTestId1); |
| 59 window_server_->user_id_tracker()->SetActiveUserId(kTestId1); | 57 window_server_->user_id_tracker()->SetActiveUserId(kTestId1); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 MoveCursorTo(gfx::Point(15, 15)); | 187 MoveCursorTo(gfx::Point(15, 15)); |
| 190 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, mojom::Cursor(cursor_id_)); | 188 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, mojom::Cursor(cursor_id_)); |
| 191 | 189 |
| 192 win->SetBounds(gfx::Rect(0, 0, 30, 30)); | 190 win->SetBounds(gfx::Rect(0, 0, 30, 30)); |
| 193 EXPECT_EQ(mojom::Cursor::IBEAM, mojom::Cursor(cursor_id_)); | 191 EXPECT_EQ(mojom::Cursor::IBEAM, mojom::Cursor(cursor_id_)); |
| 194 } | 192 } |
| 195 | 193 |
| 196 } // namespace test | 194 } // namespace test |
| 197 } // namespace ws | 195 } // namespace ws |
| 198 } // namespace ui | 196 } // namespace ui |
| OLD | NEW |