| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 std::vector<DisplayInfo> CreateDisplayInfoListFromString( | 30 std::vector<DisplayInfo> CreateDisplayInfoListFromString( |
| 31 const std::string specs, | 31 const std::string specs, |
| 32 DisplayManager* display_manager) { | 32 DisplayManager* display_manager) { |
| 33 std::vector<DisplayInfo> display_info_list; | 33 std::vector<DisplayInfo> display_info_list; |
| 34 std::vector<std::string> parts; | 34 std::vector<std::string> parts; |
| 35 base::SplitString(specs, ',', &parts); | 35 base::SplitString(specs, ',', &parts); |
| 36 size_t index = 0; | 36 size_t index = 0; |
| 37 |
| 38 DisplayManager::DisplayList list = |
| 39 display_manager->IsInUnifiedMode() |
| 40 ? display_manager->software_mirroring_display_list() |
| 41 : display_manager->active_display_list(); |
| 42 |
| 37 for (std::vector<std::string>::const_iterator iter = parts.begin(); | 43 for (std::vector<std::string>::const_iterator iter = parts.begin(); |
| 38 iter != parts.end(); ++iter, ++index) { | 44 iter != parts.end(); ++iter, ++index) { |
| 39 int64 id = index < display_manager->GetNumDisplays() ? | 45 int64 id = (index < list.size()) ? list[index].id() |
| 40 display_manager->GetDisplayAt(index).id() : | 46 : gfx::Display::kInvalidDisplayID; |
| 41 gfx::Display::kInvalidDisplayID; | |
| 42 display_info_list.push_back( | 47 display_info_list.push_back( |
| 43 DisplayInfo::CreateFromSpecWithID(*iter, id)); | 48 DisplayInfo::CreateFromSpecWithID(*iter, id)); |
| 44 } | 49 } |
| 45 return display_info_list; | 50 return display_info_list; |
| 46 } | 51 } |
| 47 | 52 |
| 48 } // namespace | 53 } // namespace |
| 49 | 54 |
| 50 // static | 55 // static |
| 51 bool DisplayManagerTestApi::TestIfMouseWarpsAt( | 56 bool DisplayManagerTestApi::TestIfMouseWarpsAt( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 149 |
| 145 void DisplayManagerTestApi::SetAvailableColorProfiles( | 150 void DisplayManagerTestApi::SetAvailableColorProfiles( |
| 146 int64 display_id, | 151 int64 display_id, |
| 147 const std::vector<ui::ColorCalibrationProfile>& profiles) { | 152 const std::vector<ui::ColorCalibrationProfile>& profiles) { |
| 148 display_manager_->display_info_[display_id].set_available_color_profiles( | 153 display_manager_->display_info_[display_id].set_available_color_profiles( |
| 149 profiles); | 154 profiles); |
| 150 } | 155 } |
| 151 | 156 |
| 152 } // namespace test | 157 } // namespace test |
| 153 } // namespace ash | 158 } // namespace ash |
| OLD | NEW |