| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 void AddCall(const std::string& call) { | 68 void AddCall(const std::string& call) { |
| 69 if (!observer_calls_.empty()) | 69 if (!observer_calls_.empty()) |
| 70 observer_calls_ += "\n"; | 70 observer_calls_ += "\n"; |
| 71 observer_calls_ += call; | 71 observer_calls_ += call; |
| 72 } | 72 } |
| 73 | 73 |
| 74 std::string DisplayIdsToString( | 74 std::string DisplayIdsToString( |
| 75 const mojo::Array<mojom::WsDisplayPtr>& wm_displays) { | 75 const std::vector<mojom::WsDisplayPtr>& wm_displays) { |
| 76 std::string display_ids; | 76 std::string display_ids; |
| 77 for (const auto& wm_display : wm_displays) { | 77 for (const auto& wm_display : wm_displays) { |
| 78 if (!display_ids.empty()) | 78 if (!display_ids.empty()) |
| 79 display_ids += " "; | 79 display_ids += " "; |
| 80 display_ids += base::Int64ToString(wm_display->display.id()); | 80 display_ids += base::Int64ToString(wm_display->display.id()); |
| 81 } | 81 } |
| 82 return display_ids; | 82 return display_ids; |
| 83 } | 83 } |
| 84 | 84 |
| 85 // mojom::DisplayManagerObserver: | 85 // mojom::DisplayManagerObserver: |
| 86 void OnDisplays(mojo::Array<mojom::WsDisplayPtr> displays, | 86 void OnDisplays(std::vector<mojom::WsDisplayPtr> displays, |
| 87 int64_t primary_display_id, | 87 int64_t primary_display_id, |
| 88 int64_t internal_display_id) override { | 88 int64_t internal_display_id) override { |
| 89 AddCall("OnDisplays " + DisplayIdsToString(displays)); | 89 AddCall("OnDisplays " + DisplayIdsToString(displays)); |
| 90 } | 90 } |
| 91 void OnDisplaysChanged(mojo::Array<mojom::WsDisplayPtr> displays) override { | 91 void OnDisplaysChanged(std::vector<mojom::WsDisplayPtr> displays) override { |
| 92 AddCall("OnDisplaysChanged " + DisplayIdsToString(displays)); | 92 AddCall("OnDisplaysChanged " + DisplayIdsToString(displays)); |
| 93 } | 93 } |
| 94 void OnDisplayRemoved(int64_t id) override { | 94 void OnDisplayRemoved(int64_t id) override { |
| 95 AddCall("OnDisplayRemoved " + base::Int64ToString(id)); | 95 AddCall("OnDisplayRemoved " + base::Int64ToString(id)); |
| 96 } | 96 } |
| 97 void OnPrimaryDisplayChanged(int64_t id) override { | 97 void OnPrimaryDisplayChanged(int64_t id) override { |
| 98 AddCall("OnPrimaryDisplayChanged " + base::Int64ToString(id)); | 98 AddCall("OnPrimaryDisplayChanged " + base::Int64ToString(id)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 std::string observer_calls_; | 101 std::string observer_calls_; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 base::subtle::Atomic32 location = | 241 base::subtle::Atomic32 location = |
| 242 base::subtle::NoBarrier_Load(cursor_location_memory); | 242 base::subtle::NoBarrier_Load(cursor_location_memory); |
| 243 EXPECT_EQ(gfx::Point(static_cast<int16_t>(location >> 16), | 243 EXPECT_EQ(gfx::Point(static_cast<int16_t>(location >> 16), |
| 244 static_cast<int16_t>(location & 0xFFFF)), | 244 static_cast<int16_t>(location & 0xFFFF)), |
| 245 gfx::Point(-10, -11)); | 245 gfx::Point(-10, -11)); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace test | 248 } // namespace test |
| 249 } // namespace ws | 249 } // namespace ws |
| 250 } // namespace ui | 250 } // namespace ui |
| OLD | NEW |