Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: services/ui/ws/user_display_manager_unittest.cc

Issue 2161993002: Start using display.mojom.Display in mus+ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@display_traits
Patch Set: Fixes. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ws/user_display_manager.cc ('k') | services/ui/ws/window_server_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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::WsDisplayPtr>& 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::WsDisplayPtr> 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::WsDisplayPtr> 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
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
OLDNEW
« no previous file with comments | « services/ui/ws/user_display_manager.cc ('k') | services/ui/ws/window_server_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698