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

Unified Diff: ui/display/chromeos/display_configurator_unittest.cc

Issue 280833002: Re-land "Issue 191223007: Move touch CTM from X into Chrome" (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: adding missing file again Created 6 years, 7 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 | « ui/display/chromeos/display_configurator.cc ('k') | ui/display/chromeos/ozone/touchscreen_delegate_ozone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/chromeos/display_configurator_unittest.cc
diff --git a/ui/display/chromeos/display_configurator_unittest.cc b/ui/display/chromeos/display_configurator_unittest.cc
index 1790d669779785e6ab4e18e35d27f9a003d615e5..1835d7594cc9778056fbbb62d996d27f9d75038d 100644
--- a/ui/display/chromeos/display_configurator_unittest.cc
+++ b/ui/display/chromeos/display_configurator_unittest.cc
@@ -82,18 +82,6 @@ std::string GetFramebufferAction(const gfx::Size& size,
out2 ? DisplaySnapshotToString(*out2).c_str() : "NULL");
}
-// Returns a string describing a TestNativeDisplayDelegate::ConfigureCTM() call.
-std::string GetCTMAction(
- int device_id,
- const DisplayConfigurator::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(const DisplaySnapshot& output,
HDCPState state) {
@@ -154,11 +142,6 @@ class TestTouchscreenDelegate
configure_touchscreens_(false) {}
virtual ~TestTouchscreenDelegate() {}
- const DisplayConfigurator::CoordinateTransformation& GetCTM(
- int touch_device_id) {
- return ctms_[touch_device_id];
- }
-
void set_configure_touchscreens(bool state) {
configure_touchscreens_ = state;
}
@@ -171,21 +154,12 @@ class TestTouchscreenDelegate
(*outputs)[i].touch_device_id = i + 1;
}
}
- virtual void ConfigureCTM(
- int touch_device_id,
- const DisplayConfigurator::CoordinateTransformation& ctm) OVERRIDE {
- log_->AppendAction(GetCTMAction(touch_device_id, ctm));
- ctms_[touch_device_id] = ctm;
- }
private:
ActionLogger* log_; // Not owned.
bool configure_touchscreens_;
- // Most-recently-configured transformation matrices, keyed by touch device ID.
- std::map<int, DisplayConfigurator::CoordinateTransformation> ctms_;
-
DISALLOW_COPY_AND_ASSIGN(TestTouchscreenDelegate);
};
@@ -1242,41 +1216,6 @@ TEST_F(DisplayConfiguratorTest, ContentProtectionTwoClients) {
log_->GetActionsAndClear());
}
-TEST_F(DisplayConfiguratorTest, CTMForMultiScreens) {
- touchscreen_delegate_->set_configure_touchscreens(true);
- UpdateOutputs(2, false);
- configurator_.Init(false);
- state_controller_.set_state(MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED);
- configurator_.ForceInitialConfigure(0);
-
- const int kDualHeight = small_mode_.size().height() +
- DisplayConfigurator::kVerticalGap +
- big_mode_.size().height();
- const int kDualWidth = big_mode_.size().width();
-
- DisplayConfigurator::CoordinateTransformation ctm1 =
- touchscreen_delegate_->GetCTM(1);
- DisplayConfigurator::CoordinateTransformation ctm2 =
- touchscreen_delegate_->GetCTM(2);
-
- EXPECT_EQ(small_mode_.size().height() - 1,
- round((kDualHeight - 1) * ctm1.y_scale));
- EXPECT_EQ(0, round((kDualHeight - 1) * ctm1.y_offset));
-
- EXPECT_EQ(big_mode_.size().height() - 1,
- round((kDualHeight - 1) * ctm2.y_scale));
- EXPECT_EQ(small_mode_.size().height() + DisplayConfigurator::kVerticalGap,
- round((kDualHeight - 1) * ctm2.y_offset));
-
- EXPECT_EQ(small_mode_.size().width() - 1,
- round((kDualWidth - 1) * ctm1.x_scale));
- EXPECT_EQ(0, round((kDualWidth - 1) * ctm1.x_offset));
-
- EXPECT_EQ(big_mode_.size().width() - 1,
- round((kDualWidth - 1) * ctm2.x_scale));
- EXPECT_EQ(0, round((kDualWidth - 1) * ctm2.x_offset));
-}
-
TEST_F(DisplayConfiguratorTest, HandleConfigureCrtcFailure) {
InitWithSingleOutput();
« no previous file with comments | « ui/display/chromeos/display_configurator.cc ('k') | ui/display/chromeos/ozone/touchscreen_delegate_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698