| 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 #ifndef COMPONENTS_MUS_WS_TEST_UTILS_H_ | 5 #ifndef COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| 6 #define COMPONENTS_MUS_WS_TEST_UTILS_H_ | 6 #define COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 227 |
| 228 bool did_call_create_top_level_window(uint32_t* change_id) { | 228 bool did_call_create_top_level_window(uint32_t* change_id) { |
| 229 if (!got_create_top_level_window_) | 229 if (!got_create_top_level_window_) |
| 230 return false; | 230 return false; |
| 231 | 231 |
| 232 got_create_top_level_window_ = false; | 232 got_create_top_level_window_ = false; |
| 233 *change_id = change_id_; | 233 *change_id = change_id_; |
| 234 return true; | 234 return true; |
| 235 } | 235 } |
| 236 | 236 |
| 237 bool on_perform_move_loop_called() { return on_perform_move_loop_called_; } |
| 237 bool on_accelerator_called() { return on_accelerator_called_; } | 238 bool on_accelerator_called() { return on_accelerator_called_; } |
| 238 uint32_t on_accelerator_id() { return on_accelerator_id_; } | 239 uint32_t on_accelerator_id() { return on_accelerator_id_; } |
| 239 | 240 |
| 240 private: | 241 private: |
| 241 // WindowManager: | 242 // WindowManager: |
| 242 void OnConnect(uint16_t client_id) override {} | 243 void OnConnect(uint16_t client_id) override {} |
| 243 void WmNewDisplayAdded(mus::mojom::DisplayPtr display, | 244 void WmNewDisplayAdded(mus::mojom::DisplayPtr display, |
| 244 mus::mojom::WindowDataPtr root, | 245 mus::mojom::WindowDataPtr root, |
| 245 bool drawn) override {} | 246 bool drawn) override {} |
| 246 void WmSetBounds(uint32_t change_id, | 247 void WmSetBounds(uint32_t change_id, |
| 247 uint32_t window_id, | 248 uint32_t window_id, |
| 248 const gfx::Rect& bounds) override {} | 249 const gfx::Rect& bounds) override {} |
| 249 void WmSetProperty(uint32_t change_id, | 250 void WmSetProperty(uint32_t change_id, |
| 250 uint32_t window_id, | 251 uint32_t window_id, |
| 251 const mojo::String& name, | 252 const mojo::String& name, |
| 252 mojo::Array<uint8_t> value) override {} | 253 mojo::Array<uint8_t> value) override {} |
| 253 void WmCreateTopLevelWindow( | 254 void WmCreateTopLevelWindow( |
| 254 uint32_t change_id, | 255 uint32_t change_id, |
| 255 ClientSpecificId requesting_client_id, | 256 ClientSpecificId requesting_client_id, |
| 256 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) override; | 257 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) override; |
| 257 void WmClientJankinessChanged(ClientSpecificId client_id, | 258 void WmClientJankinessChanged(ClientSpecificId client_id, |
| 258 bool janky) override; | 259 bool janky) override; |
| 260 void WmPerformMoveLoop(uint32_t change_id, |
| 261 uint32_t window_id, |
| 262 const gfx::Point& cursor_location) override; |
| 263 void WmCancelMoveLoop(uint32_t window_id) override; |
| 259 void OnAccelerator(uint32_t id, std::unique_ptr<ui::Event> event) override; | 264 void OnAccelerator(uint32_t id, std::unique_ptr<ui::Event> event) override; |
| 260 | 265 |
| 266 bool on_perform_move_loop_called_ = false; |
| 267 |
| 261 bool got_create_top_level_window_; | 268 bool got_create_top_level_window_; |
| 262 uint32_t change_id_; | 269 uint32_t change_id_; |
| 263 | 270 |
| 264 bool on_accelerator_called_; | 271 bool on_accelerator_called_; |
| 265 uint32_t on_accelerator_id_; | 272 uint32_t on_accelerator_id_; |
| 266 | 273 |
| 267 DISALLOW_COPY_AND_ASSIGN(TestWindowManager); | 274 DISALLOW_COPY_AND_ASSIGN(TestWindowManager); |
| 268 }; | 275 }; |
| 269 | 276 |
| 270 // ----------------------------------------------------------------------------- | 277 // ----------------------------------------------------------------------------- |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 void OnWindowInputEvent(uint32_t event_id, | 336 void OnWindowInputEvent(uint32_t event_id, |
| 330 uint32_t window, | 337 uint32_t window, |
| 331 std::unique_ptr<ui::Event> event, | 338 std::unique_ptr<ui::Event> event, |
| 332 uint32_t event_observer_id) override; | 339 uint32_t event_observer_id) override; |
| 333 void OnEventObserved(std::unique_ptr<ui::Event> event, | 340 void OnEventObserved(std::unique_ptr<ui::Event> event, |
| 334 uint32_t event_observer_id) override; | 341 uint32_t event_observer_id) override; |
| 335 void OnWindowFocused(uint32_t focused_window_id) override; | 342 void OnWindowFocused(uint32_t focused_window_id) override; |
| 336 void OnWindowPredefinedCursorChanged(uint32_t window_id, | 343 void OnWindowPredefinedCursorChanged(uint32_t window_id, |
| 337 mojom::Cursor cursor_id) override; | 344 mojom::Cursor cursor_id) override; |
| 338 void OnChangeCompleted(uint32_t change_id, bool success) override; | 345 void OnChangeCompleted(uint32_t change_id, bool success) override; |
| 346 void OnMoveLoopCompleted(uint32_t change_id, bool success) override; |
| 339 void RequestClose(uint32_t window_id) override; | 347 void RequestClose(uint32_t window_id) override; |
| 340 void GetWindowManager( | 348 void GetWindowManager( |
| 341 mojo::AssociatedInterfaceRequest<mojom::WindowManager> internal) override; | 349 mojo::AssociatedInterfaceRequest<mojom::WindowManager> internal) override; |
| 342 | 350 |
| 343 TestChangeTracker tracker_; | 351 TestChangeTracker tracker_; |
| 344 mojo::Binding<mojom::WindowTreeClient> binding_; | 352 mojo::Binding<mojom::WindowTreeClient> binding_; |
| 345 bool record_on_change_completed_ = false; | 353 bool record_on_change_completed_ = false; |
| 346 | 354 |
| 347 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClient); | 355 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClient); |
| 348 }; | 356 }; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); | 508 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); |
| 501 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, | 509 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, |
| 502 ServerWindow* parent, | 510 ServerWindow* parent, |
| 503 ClientWindowId* client_id); | 511 ClientWindowId* client_id); |
| 504 | 512 |
| 505 } // namespace test | 513 } // namespace test |
| 506 } // namespace ws | 514 } // namespace ws |
| 507 } // namespace mus | 515 } // namespace mus |
| 508 | 516 |
| 509 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ | 517 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| OLD | NEW |