OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/test/display_manager_test_api.h" | 5 #include "ash/test/display_manager_test_api.h" |
6 | 6 |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 for (std::vector<DisplayInfo>::iterator iter = display_info_list.begin(); | 102 for (std::vector<DisplayInfo>::iterator iter = display_info_list.begin(); |
103 iter != display_info_list.end(); ++iter) { | 103 iter != display_info_list.end(); ++iter) { |
104 gfx::Rect bounds(iter->bounds_in_native().size()); | 104 gfx::Rect bounds(iter->bounds_in_native().size()); |
105 bounds.set_x(1); | 105 bounds.set_x(1); |
106 bounds.set_y(next_y); | 106 bounds.set_y(next_y); |
107 next_y += bounds.height(); | 107 next_y += bounds.height(); |
108 iter->SetBounds(bounds); | 108 iter->SetBounds(bounds); |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 // TODO(msw): This seems to cause test hangs on Windows. http://crbug.com/584038 | |
113 #if !defined(OS_WIN) | |
114 display_manager_->OnNativeDisplaysChanged(display_info_list); | 112 display_manager_->OnNativeDisplaysChanged(display_info_list); |
115 display_manager_->UpdateInternalDisplayModeListForTest(); | 113 display_manager_->UpdateInternalDisplayModeListForTest(); |
116 display_manager_->RunPendingTasksForTest(); | 114 display_manager_->RunPendingTasksForTest(); |
117 #endif | |
118 } | 115 } |
119 | 116 |
120 int64_t DisplayManagerTestApi::SetFirstDisplayAsInternalDisplay() { | 117 int64_t DisplayManagerTestApi::SetFirstDisplayAsInternalDisplay() { |
121 const display::Display& internal = display_manager_->active_display_list_[0]; | 118 const display::Display& internal = display_manager_->active_display_list_[0]; |
122 SetInternalDisplayId(internal.id()); | 119 SetInternalDisplayId(internal.id()); |
123 return display::Display::InternalDisplayId(); | 120 return display::Display::InternalDisplayId(); |
124 } | 121 } |
125 | 122 |
126 void DisplayManagerTestApi::SetInternalDisplayId(int64_t id) { | 123 void DisplayManagerTestApi::SetInternalDisplayId(int64_t id) { |
127 display::Display::SetInternalDisplayId(id); | 124 display::Display::SetInternalDisplayId(id); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 for (size_t i = 0; i < count; i++) { | 196 for (size_t i = 0; i < count; i++) { |
200 int64_t id = va_arg(args, int64_t); | 197 int64_t id = va_arg(args, int64_t); |
201 list.push_back(id); | 198 list.push_back(id); |
202 } | 199 } |
203 SortDisplayIdList(&list); | 200 SortDisplayIdList(&list); |
204 return list; | 201 return list; |
205 } | 202 } |
206 | 203 |
207 } // namespace test | 204 } // namespace test |
208 } // namespace ash | 205 } // namespace ash |
OLD | NEW |