| OLD | NEW |
| 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 "services/ui/public/cpp/tests/test_window_tree.h" | 5 #include "services/ui/public/cpp/tests/test_window_tree.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 return true; | 23 return true; |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool TestWindowTree::WasEventAcked(uint32_t event_id) const { | 26 bool TestWindowTree::WasEventAcked(uint32_t event_id) const { |
| 27 return acked_events_.count(event_id); | 27 return acked_events_.count(event_id); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void TestWindowTree::NewWindow( | 30 void TestWindowTree::NewWindow( |
| 31 uint32_t change_id, | 31 uint32_t change_id, |
| 32 uint32_t window_id, | 32 uint32_t window_id, |
| 33 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) {} | 33 const base::Optional<std::unordered_map<std::string, std::vector<uint8_t>>>& |
| 34 properties) {} |
| 34 | 35 |
| 35 void TestWindowTree::NewTopLevelWindow( | 36 void TestWindowTree::NewTopLevelWindow( |
| 36 uint32_t change_id, | 37 uint32_t change_id, |
| 37 uint32_t window_id, | 38 uint32_t window_id, |
| 38 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) { | 39 const std::unordered_map<std::string, std::vector<uint8_t>>& properties) { |
| 39 got_change_ = true; | 40 got_change_ = true; |
| 40 change_id_ = change_id; | 41 change_id_ = change_id; |
| 41 window_id_ = window_id; | 42 window_id_ = window_id; |
| 42 } | 43 } |
| 43 | 44 |
| 44 void TestWindowTree::DeleteWindow(uint32_t change_id, uint32_t window_id) {} | 45 void TestWindowTree::DeleteWindow(uint32_t change_id, uint32_t window_id) {} |
| 45 | 46 |
| 46 void TestWindowTree::SetWindowBounds(uint32_t change_id, | 47 void TestWindowTree::SetWindowBounds(uint32_t change_id, |
| 47 uint32_t window_id, | 48 uint32_t window_id, |
| 48 const gfx::Rect& bounds) { | 49 const gfx::Rect& bounds) { |
| 49 got_change_ = true; | 50 got_change_ = true; |
| 50 change_id_ = change_id; | 51 change_id_ = change_id; |
| 51 } | 52 } |
| 52 | 53 |
| 53 void TestWindowTree::SetClientArea( | 54 void TestWindowTree::SetClientArea( |
| 54 uint32_t window_id, | 55 uint32_t window_id, |
| 55 const gfx::Insets& insets, | 56 const gfx::Insets& insets, |
| 56 mojo::Array<gfx::Rect> additional_client_areas) {} | 57 const base::Optional<std::vector<gfx::Rect>>& additional_client_areas) {} |
| 57 | 58 |
| 58 void TestWindowTree::SetHitTestMask(uint32_t window_id, | 59 void TestWindowTree::SetHitTestMask(uint32_t window_id, |
| 59 const base::Optional<gfx::Rect>& mask) {} | 60 const base::Optional<gfx::Rect>& mask) {} |
| 60 | 61 |
| 61 void TestWindowTree::SetCanAcceptDrops(uint32_t window_id, bool accepts_drops) { | 62 void TestWindowTree::SetCanAcceptDrops(uint32_t window_id, bool accepts_drops) { |
| 62 } | 63 } |
| 63 | 64 |
| 64 void TestWindowTree::SetWindowVisibility(uint32_t change_id, | 65 void TestWindowTree::SetWindowVisibility(uint32_t change_id, |
| 65 uint32_t window_id, | 66 uint32_t window_id, |
| 66 bool visible) { | 67 bool visible) { |
| 67 got_change_ = true; | 68 got_change_ = true; |
| 68 change_id_ = change_id; | 69 change_id_ = change_id; |
| 69 } | 70 } |
| 70 | 71 |
| 71 void TestWindowTree::SetWindowProperty(uint32_t change_id, | 72 void TestWindowTree::SetWindowProperty( |
| 72 uint32_t window_id, | 73 uint32_t change_id, |
| 73 const mojo::String& name, | 74 uint32_t window_id, |
| 74 mojo::Array<uint8_t> value) { | 75 const std::string& name, |
| 76 const base::Optional<std::vector<uint8_t>>& value) { |
| 75 got_change_ = true; | 77 got_change_ = true; |
| 76 change_id_ = change_id; | 78 change_id_ = change_id; |
| 77 } | 79 } |
| 78 | 80 |
| 79 void TestWindowTree::SetWindowOpacity(uint32_t change_id, | 81 void TestWindowTree::SetWindowOpacity(uint32_t change_id, |
| 80 uint32_t window_id, | 82 uint32_t window_id, |
| 81 float opacity) { | 83 float opacity) { |
| 82 got_change_ = true; | 84 got_change_ = true; |
| 83 change_id_ = change_id; | 85 change_id_ = change_id; |
| 84 } | 86 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) {} | 169 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) {} |
| 168 | 170 |
| 169 void TestWindowTree::GetCursorLocationMemory( | 171 void TestWindowTree::GetCursorLocationMemory( |
| 170 const GetCursorLocationMemoryCallback& callback) { | 172 const GetCursorLocationMemoryCallback& callback) { |
| 171 callback.Run(mojo::ScopedSharedBufferHandle()); | 173 callback.Run(mojo::ScopedSharedBufferHandle()); |
| 172 } | 174 } |
| 173 | 175 |
| 174 void TestWindowTree::PerformDragDrop( | 176 void TestWindowTree::PerformDragDrop( |
| 175 uint32_t change_id, | 177 uint32_t change_id, |
| 176 uint32_t source_window_id, | 178 uint32_t source_window_id, |
| 177 mojo::Map<mojo::String, mojo::Array<uint8_t>> drag_data, | 179 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, |
| 178 uint32_t drag_operation) {} | 180 uint32_t drag_operation) {} |
| 179 | 181 |
| 180 void TestWindowTree::CancelDragDrop(uint32_t window_id) {} | 182 void TestWindowTree::CancelDragDrop(uint32_t window_id) {} |
| 181 | 183 |
| 182 void TestWindowTree::PerformWindowMove(uint32_t change_id, | 184 void TestWindowTree::PerformWindowMove(uint32_t change_id, |
| 183 uint32_t window_id, | 185 uint32_t window_id, |
| 184 mojom::MoveLoopSource source, | 186 mojom::MoveLoopSource source, |
| 185 const gfx::Point& cursor_location) {} | 187 const gfx::Point& cursor_location) {} |
| 186 | 188 |
| 187 void TestWindowTree::CancelWindowMove(uint32_t window_id) {} | 189 void TestWindowTree::CancelWindowMove(uint32_t window_id) {} |
| 188 | 190 |
| 189 } // namespace ui | 191 } // namespace ui |
| OLD | NEW |