| Index: ui/display/manager/managed_display_info_unittest.cc
|
| diff --git a/ui/display/manager/managed_display_info_unittest.cc b/ui/display/manager/managed_display_info_unittest.cc
|
| index 8a06a19e354a07ebba467cd9e79338ff3e2d56fa..b27dcc4327421a5b28233fa46d485ffb19e3f985 100644
|
| --- a/ui/display/manager/managed_display_info_unittest.cc
|
| +++ b/ui/display/manager/managed_display_info_unittest.cc
|
| @@ -147,4 +147,41 @@ TEST_F(DisplayInfoTest, InputDevicesTest) {
|
| EXPECT_EQ(0u, copy_info.input_devices().size());
|
| }
|
|
|
| +TEST_F(DisplayInfoTest, TouchCalibrationTest) {
|
| + ManagedDisplayInfo info =
|
| + ManagedDisplayInfo::CreateFromSpecWithID("200x100", 10);
|
| +
|
| + EXPECT_FALSE(info.has_touch_calibration_data());
|
| +
|
| + TouchCalibrationData::CalibrationPointPairQuad points = {{
|
| + std::make_pair(gfx::Point(10, 10), gfx::Point(11, 12)),
|
| + std::make_pair(gfx::Point(190, 10), gfx::Point(195, 8)),
|
| + std::make_pair(gfx::Point(10, 90), gfx::Point(12, 94)),
|
| + std::make_pair(gfx::Point(190, 90), gfx::Point(189, 88))
|
| + }};
|
| +
|
| + gfx::Size size(200, 100);
|
| +
|
| + TouchCalibrationData expected_data(points, size);
|
| +
|
| + // Add touch data for the display.
|
| + info.SetTouchCalibrationData(expected_data);
|
| +
|
| + EXPECT_TRUE(info.has_touch_calibration_data());
|
| + TouchCalibrationData actual_data = info.GetTouchCalibrationData();
|
| + EXPECT_EQ(actual_data.bounds, size);
|
| + for (size_t i = 0; i < expected_data.point_pairs.size(); i++) {
|
| + EXPECT_EQ(actual_data.point_pairs[i].first,
|
| + expected_data.point_pairs[i].first);
|
| +
|
| + EXPECT_EQ(actual_data.point_pairs[i].second,
|
| + expected_data.point_pairs[i].second);
|
| + }
|
| +
|
| + // Clear all touch calibration data for the display.
|
| + info.clear_touch_calibration_data();
|
| +
|
| + EXPECT_FALSE(info.has_touch_calibration_data());
|
| +}
|
| +
|
| } // namespace display
|
|
|