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

Unified Diff: ash/touch/touch_transformer_controller_unittest.cc

Issue 412553005: Scale touch event radius (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/touch/touch_transformer_controller.cc ('k') | ui/events/device_data_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/touch/touch_transformer_controller_unittest.cc
diff --git a/ash/touch/touch_transformer_controller_unittest.cc b/ash/touch/touch_transformer_controller_unittest.cc
index ca64baa4789ca35379dda2ab1a445c65e5bb21a5..cff2c5356e8f481bd2c64a505374a39cb0ce1518 100644
--- a/ash/touch/touch_transformer_controller_unittest.cc
+++ b/ash/touch/touch_transformer_controller_unittest.cc
@@ -8,6 +8,7 @@
#include "ash/test/ash_test_base.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/device_data_manager.h"
+#include "ui/events/test/events_test_utils_x11.h"
#include "ui/gfx/display.h"
namespace ash {
@@ -203,4 +204,17 @@ TEST_F(TouchTransformerControllerTest, TouchTransformerExtendedMode) {
EXPECT_EQ(1599, static_cast<int>(y));
}
+TEST_F(TouchTransformerControllerTest, TouchRadiusScale) {
+ DisplayInfo display = CreateDisplayInfo(1, 5, gfx::Rect(0, 0, 2560, 1600));
+ std::vector<unsigned int> devices;
+ devices.push_back(5);
+ ui::SetUpTouchDevicesForTest(devices);
+
+ TouchTransformerController* tt_controller =
+ Shell::GetInstance()->touch_transformer_controller();
+ // Default touchscreen position range is 1001x1001;
+ EXPECT_EQ(sqrt((2560.0 * 1600.0) / (1001.0 * 1001.0)),
+ tt_controller->GetTouchResolutionScale(display));
+}
+
} // namespace ash
« no previous file with comments | « ash/touch/touch_transformer_controller.cc ('k') | ui/events/device_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698