| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/display/manager/managed_display_info.h" | 5 #include "ui/display/manager/managed_display_info.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace display { | 9 namespace display { |
| 10 namespace { | 10 namespace { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 }}; | 161 }}; |
| 162 | 162 |
| 163 gfx::Size size(200, 100); | 163 gfx::Size size(200, 100); |
| 164 | 164 |
| 165 TouchCalibrationData expected_data(points, size); | 165 TouchCalibrationData expected_data(points, size); |
| 166 | 166 |
| 167 // Add touch data for the display. | 167 // Add touch data for the display. |
| 168 info.SetTouchCalibrationData(expected_data); | 168 info.SetTouchCalibrationData(expected_data); |
| 169 | 169 |
| 170 EXPECT_TRUE(info.has_touch_calibration_data()); | 170 EXPECT_TRUE(info.has_touch_calibration_data()); |
| 171 TouchCalibrationData actual_data = info.GetTouchCalibrationData(); | 171 EXPECT_EQ(expected_data, info.GetTouchCalibrationData()); |
| 172 EXPECT_EQ(actual_data.bounds, size); | |
| 173 for (size_t i = 0; i < expected_data.point_pairs.size(); i++) { | |
| 174 EXPECT_EQ(actual_data.point_pairs[i].first, | |
| 175 expected_data.point_pairs[i].first); | |
| 176 | |
| 177 EXPECT_EQ(actual_data.point_pairs[i].second, | |
| 178 expected_data.point_pairs[i].second); | |
| 179 } | |
| 180 | 172 |
| 181 // Clear all touch calibration data for the display. | 173 // Clear all touch calibration data for the display. |
| 182 info.clear_touch_calibration_data(); | 174 info.clear_touch_calibration_data(); |
| 183 | 175 |
| 184 EXPECT_FALSE(info.has_touch_calibration_data()); | 176 EXPECT_FALSE(info.has_touch_calibration_data()); |
| 185 } | 177 } |
| 186 | 178 |
| 187 } // namespace display | 179 } // namespace display |
| OLD | NEW |