Skip to content

Commit

Permalink
ash: Never associate an internal touchscreen with an external display
Browse files Browse the repository at this point in the history
BUG=515201
TEST=TouchscreenUtilTest.TestWithNoInternalDisplay updated to reflect
that internal touchscreen should not be associated with any display.

Review URL: https://codereview.chromium.org/1254413010

Cr-Commit-Position: refs/heads/master@{#341564}
  • Loading branch information
rbradford authored and Commit bot committed Aug 3, 2015
1 parent 53fee7c commit e2111b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ash/touch/touchscreen_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ void AssociateTouchscreens(std::vector<DisplayInfo>* displays,

std::set<int> no_match_touchscreen;
for (size_t i = 0; i < devices.size(); ++i) {
if (internal_state &&
devices[i].type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) {
if (devices[i].type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) {
// Don't try and map internal touchscreens to external displays.
if (!internal_state)
continue;
VLOG(2) << "Found internal device for display " << internal_state->id()
<< " with device id " << devices[i].id << " size "
<< devices[i].size.ToString();
Expand Down
4 changes: 2 additions & 2 deletions ash/touch/touchscreen_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ TEST_F(TouchscreenUtilTest, TestWithNoInternalDisplay) {
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "",
gfx::Size(9999, 888), 0));

// Internal touchscreen should not be associated with any display
AssociateTouchscreens(&displays_, devices);

EXPECT_EQ(1u, displays_[0].input_devices().size());
EXPECT_EQ(1, displays_[0].input_devices()[0]);
EXPECT_EQ(1u, displays_[1].input_devices().size());
EXPECT_EQ(2, displays_[1].input_devices()[0]);
EXPECT_EQ(0u, displays_[1].input_devices().size());
EXPECT_EQ(0u, displays_[2].input_devices().size());
EXPECT_EQ(0u, displays_[3].input_devices().size());
}
Expand Down

0 comments on commit e2111b2

Please sign in to comment.