| 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/atomicops.h" | 9 #include "base/atomicops.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 void AddCall(const std::string& call) { | 51 void AddCall(const std::string& call) { |
| 52 if (!observer_calls_.empty()) | 52 if (!observer_calls_.empty()) |
| 53 observer_calls_ += "\n"; | 53 observer_calls_ += "\n"; |
| 54 observer_calls_ += call; | 54 observer_calls_ += call; |
| 55 } | 55 } |
| 56 | 56 |
| 57 std::string DisplayIdsToString( | 57 std::string DisplayIdsToString( |
| 58 const mojo::Array<mojom::DisplayPtr>& displays) { | 58 const mojo::Array<mojom::WmDisplayPtr>& wm_displays) { |
| 59 std::string display_ids; | 59 std::string display_ids; |
| 60 for (const auto& display : displays) { | 60 for (const auto& wm_display : wm_displays) { |
| 61 if (!display_ids.empty()) | 61 if (!display_ids.empty()) |
| 62 display_ids += " "; | 62 display_ids += " "; |
| 63 display_ids += base::Int64ToString(display->id); | 63 display_ids += base::Int64ToString(wm_display->display.id()); |
| 64 } | 64 } |
| 65 return display_ids; | 65 return display_ids; |
| 66 } | 66 } |
| 67 | 67 |
| 68 // mojom::DisplayManagerObserver: | 68 // mojom::DisplayManagerObserver: |
| 69 void OnDisplays(mojo::Array<mojom::DisplayPtr> displays) override { | 69 void OnDisplays(mojo::Array<mojom::WmDisplayPtr> displays) override { |
| 70 AddCall("OnDisplays " + DisplayIdsToString(displays)); | 70 AddCall("OnDisplays " + DisplayIdsToString(displays)); |
| 71 } | 71 } |
| 72 void OnDisplaysChanged(mojo::Array<mojom::DisplayPtr> displays) override { | 72 void OnDisplaysChanged(mojo::Array<mojom::WmDisplayPtr> displays) override { |
| 73 AddCall("OnDisplaysChanged " + DisplayIdsToString(displays)); | 73 AddCall("OnDisplaysChanged " + DisplayIdsToString(displays)); |
| 74 } | 74 } |
| 75 void OnDisplayRemoved(int64_t id) override { | 75 void OnDisplayRemoved(int64_t id) override { |
| 76 AddCall("OnDisplayRemoved " + base::Int64ToString(id)); | 76 AddCall("OnDisplayRemoved " + base::Int64ToString(id)); |
| 77 } | 77 } |
| 78 | 78 |
| 79 std::string observer_calls_; | 79 std::string observer_calls_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(TestDisplayManagerObserver); | 81 DISALLOW_COPY_AND_ASSIGN(TestDisplayManagerObserver); |
| 82 }; | 82 }; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 base::subtle::Atomic32 location = | 235 base::subtle::Atomic32 location = |
| 236 base::subtle::NoBarrier_Load(cursor_location_memory); | 236 base::subtle::NoBarrier_Load(cursor_location_memory); |
| 237 EXPECT_EQ(gfx::Point(static_cast<int16_t>(location >> 16), | 237 EXPECT_EQ(gfx::Point(static_cast<int16_t>(location >> 16), |
| 238 static_cast<int16_t>(location & 0xFFFF)), | 238 static_cast<int16_t>(location & 0xFFFF)), |
| 239 gfx::Point(-10, -11)); | 239 gfx::Point(-10, -11)); |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace test | 242 } // namespace test |
| 243 } // namespace ws | 243 } // namespace ws |
| 244 } // namespace ui | 244 } // namespace ui |
| OLD | NEW |