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

Unified Diff: ash/touch/touchscreen_util_unittest.cc

Issue 2355063002: Separate ash::test::DisplayManagerTestApi from ash (Closed)
Patch Set: review comment Created 4 years, 2 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_observer_hud_unittest.cc ('k') | ash/utility/screenshot_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/touch/touchscreen_util_unittest.cc
diff --git a/ash/touch/touchscreen_util_unittest.cc b/ash/touch/touchscreen_util_unittest.cc
index f8b638e5cf8163450c5444c628ee912352784c8f..c4c710aeac9824d4a8d73449fc31e5b773f150f1 100644
--- a/ash/touch/touchscreen_util_unittest.cc
+++ b/ash/touch/touchscreen_util_unittest.cc
@@ -5,6 +5,7 @@
#include <string>
#include <vector>
+#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/display_manager_test_api.h"
#include "ash/touch/touchscreen_util.h"
@@ -86,7 +87,8 @@ class TouchscreenUtilTest : public test::AshTestBase {
TEST_F(TouchscreenUtilTest, NoTouchscreens) {
std::vector<ui::TouchscreenDevice> devices;
- test::ScopedSetInternalDisplayId set_internal(displays_[0].id());
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ displays_[0].id());
AssociateTouchscreens(&displays_, devices);
for (size_t i = 0; i < displays_.size(); ++i)
@@ -106,7 +108,8 @@ TEST_F(TouchscreenUtilTest, ManyTouchscreens) {
DisplayInfoList displays;
displays.push_back(displays_[3]);
- test::ScopedSetInternalDisplayId set_internal(displays_[0].id());
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ displays_[0].id());
AssociateTouchscreens(&displays, devices);
for (int i = 0; i < 5; ++i)
@@ -122,7 +125,8 @@ TEST_F(TouchscreenUtilTest, OneToOneMapping) {
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "2",
gfx::Size(1024, 768), 0));
- test::ScopedSetInternalDisplayId set_internal(displays_[0].id());
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ displays_[0].id());
AssociateTouchscreens(&displays_, devices);
EXPECT_EQ(0u, displays_[0].input_devices().size());
@@ -139,7 +143,8 @@ TEST_F(TouchscreenUtilTest, MapToCorrectDisplaySize) {
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "2",
gfx::Size(1024, 768), 0));
- test::ScopedSetInternalDisplayId set_internal(displays_[0].id());
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ displays_[0].id());
AssociateTouchscreens(&displays_, devices);
EXPECT_EQ(0u, displays_[0].input_devices().size());
@@ -158,7 +163,8 @@ TEST_F(TouchscreenUtilTest, MapWhenSizeDiffersByOne) {
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "2",
gfx::Size(1023, 768), 0));
- test::ScopedSetInternalDisplayId set_internal(displays_[0].id());
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ displays_[0].id());
AssociateTouchscreens(&displays_, devices);
EXPECT_EQ(0u, displays_[0].input_devices().size());
@@ -182,7 +188,8 @@ TEST_F(TouchscreenUtilTest, MapWhenSizesDoNotMatch) {
displays.push_back(displays_[0]);
displays.push_back(displays_[1]);
- test::ScopedSetInternalDisplayId set_internal(displays[0].id());
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ displays[0].id());
AssociateTouchscreens(&displays, devices);
EXPECT_EQ(0u, displays[0].input_devices().size());
@@ -204,7 +211,8 @@ TEST_F(TouchscreenUtilTest, MapInternalTouchscreen) {
displays.push_back(displays_[0]);
displays.push_back(displays_[1]);
- test::ScopedSetInternalDisplayId set_internal(displays[0].id());
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ displays[0].id());
AssociateTouchscreens(&displays, devices);
// Internal touchscreen is always mapped to internal display.
@@ -223,7 +231,8 @@ TEST_F(TouchscreenUtilTest, MultipleInternal) {
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "2",
gfx::Size(1920, 1080), 0));
- test::ScopedSetInternalDisplayId set_internal(displays_[0].id());
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ displays_[0].id());
AssociateTouchscreens(&displays_, devices);
EXPECT_EQ(2u, displays_[0].input_devices().size());
@@ -244,7 +253,8 @@ TEST_F(TouchscreenUtilTest, MultipleInternalAndExternal) {
ui::TouchscreenDevice(3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "3",
gfx::Size(1024, 768), 0));
- test::ScopedSetInternalDisplayId set_internal(displays_[0].id());
+ test::ScopedSetInternalDisplayId set_internal(
+ Shell::GetInstance()->display_manager(), displays_[0].id());
AssociateTouchscreens(&displays_, devices);
EXPECT_EQ(2u, displays_[0].input_devices().size());
« no previous file with comments | « ash/touch/touch_observer_hud_unittest.cc ('k') | ash/utility/screenshot_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698