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

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

Issue 394063004: Associate internal touchscreen to internal display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-formatting 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
Index: ui/display/chromeos/touchscreen_delegate_impl_unittest.cc
diff --git a/ui/display/chromeos/touchscreen_delegate_impl_unittest.cc b/ui/display/chromeos/touchscreen_delegate_impl_unittest.cc
index b41fbdbacc0d973064ad703717d4d6f10475d9d4..24386c02aa4bb9abe852c0d6a83753d659e30921 100644
--- a/ui/display/chromeos/touchscreen_delegate_impl_unittest.cc
+++ b/ui/display/chromeos/touchscreen_delegate_impl_unittest.cc
@@ -110,8 +110,8 @@ TEST_F(TouchscreenDelegateImplTest, NoTouchscreens) {
}
TEST_F(TouchscreenDelegateImplTest, OneToOneMapping) {
- device_manager_->AddDevice(TouchscreenDevice(1, gfx::Size(800, 600)));
- device_manager_->AddDevice(TouchscreenDevice(2, gfx::Size(1024, 768)));
+ device_manager_->AddDevice(TouchscreenDevice(1, gfx::Size(800, 600), false));
+ device_manager_->AddDevice(TouchscreenDevice(2, gfx::Size(1024, 768), false));
std::vector<DisplayConfigurator::DisplayState> display_states =
GetDisplayStates();
@@ -124,7 +124,7 @@ TEST_F(TouchscreenDelegateImplTest, OneToOneMapping) {
}
TEST_F(TouchscreenDelegateImplTest, MapToCorrectDisplaySize) {
- device_manager_->AddDevice(TouchscreenDevice(2, gfx::Size(1024, 768)));
+ device_manager_->AddDevice(TouchscreenDevice(2, gfx::Size(1024, 768), false));
std::vector<DisplayConfigurator::DisplayState> display_states =
GetDisplayStates();
@@ -137,8 +137,8 @@ TEST_F(TouchscreenDelegateImplTest, MapToCorrectDisplaySize) {
}
TEST_F(TouchscreenDelegateImplTest, MapWhenSizeDiffersByOne) {
- device_manager_->AddDevice(TouchscreenDevice(1, gfx::Size(801, 600)));
- device_manager_->AddDevice(TouchscreenDevice(2, gfx::Size(1023, 768)));
+ device_manager_->AddDevice(TouchscreenDevice(1, gfx::Size(801, 600), false));
+ device_manager_->AddDevice(TouchscreenDevice(2, gfx::Size(1023, 768), false));
std::vector<DisplayConfigurator::DisplayState> display_states =
GetDisplayStates();
@@ -151,8 +151,8 @@ TEST_F(TouchscreenDelegateImplTest, MapWhenSizeDiffersByOne) {
}
TEST_F(TouchscreenDelegateImplTest, MapWhenSizesDoNotMatch) {
- device_manager_->AddDevice(TouchscreenDevice(1, gfx::Size(1022, 768)));
- device_manager_->AddDevice(TouchscreenDevice(2, gfx::Size(802, 600)));
+ device_manager_->AddDevice(TouchscreenDevice(1, gfx::Size(1022, 768), false));
+ device_manager_->AddDevice(TouchscreenDevice(2, gfx::Size(802, 600), false));
std::vector<DisplayConfigurator::DisplayState> display_states =
GetDisplayStates();
@@ -164,4 +164,18 @@ TEST_F(TouchscreenDelegateImplTest, MapWhenSizesDoNotMatch) {
EXPECT_EQ(2, display_states[3].touch_device_id);
}
+TEST_F(TouchscreenDelegateImplTest, MapInternalTouchscreen) {
+ // Internal touchscreen is always mapped to internal display.
+ device_manager_->AddDevice(TouchscreenDevice(1, gfx::Size(9999, 888), true));
dnicoara 2014/07/16 13:42:35 Could you add another external touchscreen before
Yufeng Shen (Slow to review) 2014/07/16 20:20:27 Done.
+
+ std::vector<DisplayConfigurator::DisplayState> display_states =
+ GetDisplayStates();
+ delegate_->AssociateTouchscreens(&display_states);
+
+ EXPECT_EQ(1, display_states[0].touch_device_id);
+ EXPECT_EQ(TouchscreenDevice::kInvalidId, display_states[1].touch_device_id);
+ EXPECT_EQ(TouchscreenDevice::kInvalidId, display_states[2].touch_device_id);
+ EXPECT_EQ(TouchscreenDevice::kInvalidId, display_states[3].touch_device_id);
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698