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

Unified Diff: chromeos/display/output_configurator_unittest.cc

Issue 191223007: Move touch CTM from X into Chrome (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add file ui/aura/touch_ctm.h(cc) Created 6 years, 9 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
Index: chromeos/display/output_configurator_unittest.cc
diff --git a/chromeos/display/output_configurator_unittest.cc b/chromeos/display/output_configurator_unittest.cc
index b269c7bcccc3c75a819c221bf39e178507d4d4b6..bc562cd052a2b6d26edc42d19fd9f9bfe52d1291 100644
--- a/chromeos/display/output_configurator_unittest.cc
+++ b/chromeos/display/output_configurator_unittest.cc
@@ -67,14 +67,6 @@ std::string GetFramebufferAction(int width,
width, height, crtc1, crtc2);
}
-// Returns a string describing a TestNativeDisplayDelegate::ConfigureCTM() call.
-std::string GetCTMAction(
- int device_id,
- const OutputConfigurator::CoordinateTransformation& ctm) {
- return base::StringPrintf("ctm(id=%d,transform=(%f,%f,%f,%f))", device_id,
- ctm.x_scale, ctm.x_offset, ctm.y_scale, ctm.y_offset);
-}
-
// Returns a string describing a TestNativeDisplayDelegate::SetHDCPState() call.
std::string GetSetHDCPStateAction(RROutput id, ui::HDCPState state) {
return base::StringPrintf("set_hdcp(id=%lu,state=%d)", id, state);
@@ -130,27 +122,13 @@ class TestTouchscreenDelegate : public OutputConfigurator::TouchscreenDelegate {
explicit TestTouchscreenDelegate(ActionLogger* log) : log_(log) {}
virtual ~TestTouchscreenDelegate() {}
- const OutputConfigurator::CoordinateTransformation& GetCTM(
- int touch_device_id) {
- return ctms_[touch_device_id];
- }
-
// OutputConfigurator::TouchscreenDelegate implementation:
virtual void AssociateTouchscreens(
std::vector<OutputConfigurator::OutputSnapshot>* outputs) OVERRIDE {}
- virtual void ConfigureCTM(
- int touch_device_id,
- const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE {
- log_->AppendAction(GetCTMAction(touch_device_id, ctm));
- ctms_[touch_device_id] = ctm;
- }
private:
ActionLogger* log_; // Not owned.
- // Most-recently-configured transformation matrices, keyed by touch device ID.
- std::map<int, OutputConfigurator::CoordinateTransformation> ctms_;
-
DISALLOW_COPY_AND_ASSIGN(TestTouchscreenDelegate);
};
@@ -1437,38 +1415,6 @@ TEST_F(OutputConfiguratorTest, OutputProtectionTwoClients) {
log_->GetActionsAndClear());
}
-TEST_F(OutputConfiguratorTest, CTMForMultiScreens) {
- outputs_[0].touch_device_id = 1;
- outputs_[1].touch_device_id = 2;
-
- UpdateOutputs(2, false);
- configurator_.Init(false);
- state_controller_.set_state(ui::OUTPUT_STATE_DUAL_EXTENDED);
- configurator_.Start(0);
-
- const int kDualHeight =
- kSmallModeHeight + OutputConfigurator::kVerticalGap + kBigModeHeight;
- const int kDualWidth = kBigModeWidth;
-
- OutputConfigurator::CoordinateTransformation ctm1 =
- touchscreen_delegate_->GetCTM(1);
- OutputConfigurator::CoordinateTransformation ctm2 =
- touchscreen_delegate_->GetCTM(2);
-
- EXPECT_EQ(kSmallModeHeight - 1, round((kDualHeight - 1) * ctm1.y_scale));
- EXPECT_EQ(0, round((kDualHeight - 1) * ctm1.y_offset));
-
- EXPECT_EQ(kBigModeHeight - 1, round((kDualHeight - 1) * ctm2.y_scale));
- EXPECT_EQ(kSmallModeHeight + OutputConfigurator::kVerticalGap,
- round((kDualHeight - 1) * ctm2.y_offset));
-
- EXPECT_EQ(kSmallModeWidth - 1, round((kDualWidth - 1) * ctm1.x_scale));
- EXPECT_EQ(0, round((kDualWidth - 1) * ctm1.x_offset));
-
- EXPECT_EQ(kBigModeWidth - 1, round((kDualWidth - 1) * ctm2.x_scale));
- EXPECT_EQ(0, round((kDualWidth - 1) * ctm2.x_offset));
-}
-
TEST_F(OutputConfiguratorTest, HandleConfigureCrtcFailure) {
InitWithSingleOutput();

Powered by Google App Engine
This is Rietveld 408576698