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

Side by Side Diff: ash/host/ash_window_tree_host_x11_unittest.cc

Issue 2689143002: ash: Remove OS_CHROMEOS ifdefs from accelerator files (Closed)
Patch Set: rebase Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/host/ash_window_tree_host_x11.h" 5 #include "ash/host/ash_window_tree_host_x11.h"
6 6
7 #undef None 7 #undef None
8 #undef Bool 8 #undef Bool
9 9
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 } // namespace 56 } // namespace
57 57
58 namespace ash { 58 namespace ash {
59 59
60 class AshWindowTreeHostX11Test : public aura::test::AuraTestBase { 60 class AshWindowTreeHostX11Test : public aura::test::AuraTestBase {
61 public: 61 public:
62 void SetUp() override { 62 void SetUp() override {
63 aura::test::AuraTestBase::SetUp(); 63 aura::test::AuraTestBase::SetUp();
64 64
65 #if defined(OS_CHROMEOS)
66 // Fake a ChromeOS running env. 65 // Fake a ChromeOS running env.
67 const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n"; 66 const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n";
68 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time()); 67 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
69 #endif
70 } 68 }
71 69
72 void TearDown() override { 70 void TearDown() override {
73 aura::test::AuraTestBase::TearDown(); 71 aura::test::AuraTestBase::TearDown();
74 72
75 #if defined(OS_CHROMEOS)
76 // Revert the CrOS testing env otherwise the following non-CrOS aura 73 // Revert the CrOS testing env otherwise the following non-CrOS aura
77 // tests will fail. 74 // tests will fail.
78 // Fake a ChromeOS running env.
79 const char* kLsbRelease = ""; 75 const char* kLsbRelease = "";
80 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time()); 76 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
81 #endif
82 } 77 }
83 }; 78 };
84 79
85 // Fails on ChromeOS valgrind bot. http://crbug.com/499997
86 #if defined(OS_CHROMEOS)
87 #define MAYBE_DispatchTouchEventToOneRootWindow \
88 DISABLED_DispatchTouchEventToOneRootWindow
89 #else
90 #define MAYBE_DispatchTouchEventToOneRootWindow \
91 DispatchTouchEventToOneRootWindow
92 #endif
93
94 // Send X touch events to one WindowTreeHost. The WindowTreeHost's 80 // Send X touch events to one WindowTreeHost. The WindowTreeHost's
95 // delegate will get corresponding ui::TouchEvent if the touch events 81 // delegate will get corresponding ui::TouchEvent if the touch events
96 // are targeting this WindowTreeHost. 82 // are targeting this WindowTreeHost.
97 TEST_F(AshWindowTreeHostX11Test, MAYBE_DispatchTouchEventToOneRootWindow) { 83 // Fails on ChromeOS valgrind bot. http://crbug.com/499997
84 TEST_F(AshWindowTreeHostX11Test, DISABLED_DispatchTouchEventToOneRootWindow) {
98 std::unique_ptr<aura::WindowTreeHostX11> window_tree_host( 85 std::unique_ptr<aura::WindowTreeHostX11> window_tree_host(
99 new AshWindowTreeHostX11(gfx::Rect(0, 0, 2560, 1700))); 86 new AshWindowTreeHostX11(gfx::Rect(0, 0, 2560, 1700)));
100 window_tree_host->InitHost(); 87 window_tree_host->InitHost();
101 window_tree_host->window()->Show(); 88 window_tree_host->window()->Show();
102 std::unique_ptr<RootWindowEventHandler> handler( 89 std::unique_ptr<RootWindowEventHandler> handler(
103 new RootWindowEventHandler(window_tree_host.get())); 90 new RootWindowEventHandler(window_tree_host.get()));
104 91
105 std::vector<int> devices; 92 std::vector<int> devices;
106 devices.push_back(0); 93 devices.push_back(0);
107 ui::SetUpTouchDevicesForTest(devices); 94 ui::SetUpTouchDevicesForTest(devices);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 EXPECT_EQ(gfx::Point(0, 0), handler1->last_touch_location()); 242 EXPECT_EQ(gfx::Point(0, 0), handler1->last_touch_location());
256 EXPECT_EQ(ui::ET_TOUCH_RELEASED, handler2->last_touch_type()); 243 EXPECT_EQ(ui::ET_TOUCH_RELEASED, handler2->last_touch_type());
257 EXPECT_EQ(1, handler2->last_touch_id()); 244 EXPECT_EQ(1, handler2->last_touch_id());
258 EXPECT_EQ(gfx::Point(1600, 2650), handler2->last_touch_location()); 245 EXPECT_EQ(gfx::Point(1600, 2650), handler2->last_touch_location());
259 246
260 handler1.reset(); 247 handler1.reset();
261 handler2.reset(); 248 handler2.reset();
262 } 249 }
263 250
264 } // namespace aura 251 } // namespace aura
OLDNEW
« no previous file with comments | « ash/host/ash_window_tree_host_x11.cc ('k') | ash/mus/accelerators/accelerator_controller_delegate_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698