| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 5 |
| 6 #include "base/sys_info.h" | 6 #include "base/sys_info.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
| 9 #include "ui/aura/root_window_host_x11.h" | 9 #include "ui/aura/root_window_host_x11.h" |
| 10 #include "ui/aura/test/aura_test_base.h" | 10 #include "ui/aura/test/aura_test_base.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 #endif // defined(OS_CHROMEOS) | 103 #endif // defined(OS_CHROMEOS) |
| 104 | 104 |
| 105 scoped_ptr<RootWindowHostX11> root_window_host( | 105 scoped_ptr<RootWindowHostX11> root_window_host( |
| 106 new RootWindowHostX11(gfx::Rect(0, 0, 2560, 1700))); | 106 new RootWindowHostX11(gfx::Rect(0, 0, 2560, 1700))); |
| 107 scoped_ptr<TestRootWindowHostDelegate> delegate( | 107 scoped_ptr<TestRootWindowHostDelegate> delegate( |
| 108 new TestRootWindowHostDelegate()); | 108 new TestRootWindowHostDelegate()); |
| 109 root_window_host->set_delegate(delegate.get()); | 109 root_window_host->set_delegate(delegate.get()); |
| 110 | 110 |
| 111 std::vector<unsigned int> devices; | 111 std::vector<unsigned int> devices; |
| 112 devices.push_back(0); | 112 devices.push_back(0); |
| 113 ui::SetupTouchDevicesForTest(devices); | 113 ui::SetUpTouchDevicesForTest(devices); |
| 114 std::vector<ui::Valuator> valuators; | 114 std::vector<ui::Valuator> valuators; |
| 115 | 115 |
| 116 EXPECT_EQ(ui::ET_UNKNOWN, delegate->last_touch_type()); | 116 EXPECT_EQ(ui::ET_UNKNOWN, delegate->last_touch_type()); |
| 117 EXPECT_EQ(-1, delegate->last_touch_id()); | 117 EXPECT_EQ(-1, delegate->last_touch_id()); |
| 118 | 118 |
| 119 ui::ScopedXI2Event scoped_xevent; | 119 ui::ScopedXI2Event scoped_xevent; |
| 120 #if defined(OS_CHROMEOS) | 120 #if defined(OS_CHROMEOS) |
| 121 // This touch is out of bounds. | 121 // This touch is out of bounds. |
| 122 scoped_xevent.InitTouchEvent( | 122 scoped_xevent.InitTouchEvent( |
| 123 0, XI_TouchBegin, 5, gfx::Point(1500, 2500), valuators); | 123 0, XI_TouchBegin, 5, gfx::Point(1500, 2500), valuators); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 int host2_y_offset = 1700; | 176 int host2_y_offset = 1700; |
| 177 scoped_ptr<RootWindowHostX11> root_window_host2( | 177 scoped_ptr<RootWindowHostX11> root_window_host2( |
| 178 new RootWindowHostX11(gfx::Rect(0, host2_y_offset, 1920, 1080))); | 178 new RootWindowHostX11(gfx::Rect(0, host2_y_offset, 1920, 1080))); |
| 179 scoped_ptr<TestRootWindowHostDelegate> delegate2( | 179 scoped_ptr<TestRootWindowHostDelegate> delegate2( |
| 180 new TestRootWindowHostDelegate()); | 180 new TestRootWindowHostDelegate()); |
| 181 root_window_host2->set_delegate(delegate2.get()); | 181 root_window_host2->set_delegate(delegate2.get()); |
| 182 | 182 |
| 183 std::vector<unsigned int> devices; | 183 std::vector<unsigned int> devices; |
| 184 devices.push_back(0); | 184 devices.push_back(0); |
| 185 ui::SetupTouchDevicesForTest(devices); | 185 ui::SetUpTouchDevicesForTest(devices); |
| 186 std::vector<ui::Valuator> valuators; | 186 std::vector<ui::Valuator> valuators; |
| 187 | 187 |
| 188 EXPECT_EQ(ui::ET_UNKNOWN, delegate1->last_touch_type()); | 188 EXPECT_EQ(ui::ET_UNKNOWN, delegate1->last_touch_type()); |
| 189 EXPECT_EQ(-1, delegate1->last_touch_id()); | 189 EXPECT_EQ(-1, delegate1->last_touch_id()); |
| 190 EXPECT_EQ(ui::ET_UNKNOWN, delegate2->last_touch_type()); | 190 EXPECT_EQ(ui::ET_UNKNOWN, delegate2->last_touch_type()); |
| 191 EXPECT_EQ(-1, delegate2->last_touch_id()); | 191 EXPECT_EQ(-1, delegate2->last_touch_id()); |
| 192 | 192 |
| 193 // 2 Touch events are targeted at the second RootWindowHost. | 193 // 2 Touch events are targeted at the second RootWindowHost. |
| 194 ui::ScopedXI2Event scoped_xevent; | 194 ui::ScopedXI2Event scoped_xevent; |
| 195 scoped_xevent.InitTouchEvent( | 195 scoped_xevent.InitTouchEvent( |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 // Revert the CrOS testing env otherwise the following non-CrOS aura | 267 // Revert the CrOS testing env otherwise the following non-CrOS aura |
| 268 // tests will fail. | 268 // tests will fail. |
| 269 // Fake a ChromeOS running env. | 269 // Fake a ChromeOS running env. |
| 270 kLsbRelease = ""; | 270 kLsbRelease = ""; |
| 271 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time()); | 271 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time()); |
| 272 } | 272 } |
| 273 #endif // defined(OS_CHROMEOS) | 273 #endif // defined(OS_CHROMEOS) |
| 274 | 274 |
| 275 } // namespace aura | 275 } // namespace aura |
| OLD | NEW |