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

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

Issue 2497303002: Fix ws::Display initialization order. (Closed)
Patch Set: Fix use after move in test. Created 4 years, 1 month 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/test_utils.cc ('k') | services/ui/ws/window_tree_host_factory.cc » ('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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 window_server() 193 window_server()
194 ->window_manager_window_tree_factory_set() 194 ->window_manager_window_tree_factory_set()
195 ->GetWindowManagerStateForUser(kUserId1) 195 ->GetWindowManagerStateForUser(kUserId1)
196 ->SetFrameDecorationValues(CreateDefaultFrameDecorationValues()); 196 ->SetFrameDecorationValues(CreateDefaultFrameDecorationValues());
197 UserDisplayManagerTestApi(user_display_manager1) 197 UserDisplayManagerTestApi(user_display_manager1)
198 .SetTestObserver(&display_manager_observer1); 198 .SetTestObserver(&display_manager_observer1);
199 EXPECT_EQ("OnDisplays 1", 199 EXPECT_EQ("OnDisplays 1",
200 display_manager_observer1.GetAndClearObserverCalls()); 200 display_manager_observer1.GetAndClearObserverCalls());
201 201
202 // Add another display. 202 // Add another display.
203 Display* display2 = new Display(window_server(), PlatformDisplayInitParams()); 203 Display* display2 = new Display(window_server());
204 display2->Init(nullptr); 204 display2->Init(PlatformDisplayInitParams(), nullptr);
205 205
206 // Observer should be notified immediately as frame decorations were set. 206 // Observer should be notified immediately as frame decorations were set.
207 EXPECT_EQ("OnDisplaysChanged 2", 207 EXPECT_EQ("OnDisplaysChanged 2",
208 display_manager_observer1.GetAndClearObserverCalls()); 208 display_manager_observer1.GetAndClearObserverCalls());
209 209
210 // Remove the display and verify observer is notified. 210 // Remove the display and verify observer is notified.
211 display_manager->DestroyDisplay(display2); 211 display_manager->DestroyDisplay(display2);
212 display2 = nullptr; 212 display2 = nullptr;
213 EXPECT_EQ("OnDisplayRemoved 2", 213 EXPECT_EQ("OnDisplayRemoved 2",
214 display_manager_observer1.GetAndClearObserverCalls()); 214 display_manager_observer1.GetAndClearObserverCalls());
(...skipping 26 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_tree_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698