OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1724 const EventFilterRecorder::Events& events = filter->events(); | 1724 const EventFilterRecorder::Events& events = filter->events(); |
1725 EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_SCROLL_END GESTURE_END", | 1725 EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_SCROLL_END GESTURE_END", |
1726 EventTypesToString(events)); | 1726 EventTypesToString(events)); |
1727 ASSERT_EQ(2u, filter->touch_locations().size()); | 1727 ASSERT_EQ(2u, filter->touch_locations().size()); |
1728 EXPECT_EQ(gfx::Point(-40, 10).ToString(), | 1728 EXPECT_EQ(gfx::Point(-40, 10).ToString(), |
1729 filter->touch_locations()[0].ToString()); | 1729 filter->touch_locations()[0].ToString()); |
1730 EXPECT_EQ(gfx::Point(-40, 10).ToString(), | 1730 EXPECT_EQ(gfx::Point(-40, 10).ToString(), |
1731 filter->touch_locations()[1].ToString()); | 1731 filter->touch_locations()[1].ToString()); |
1732 } | 1732 } |
1733 | 1733 |
1734 class RootWindowTestRotated : public RootWindowTest { | |
1735 public: | |
1736 RootWindowTestRotated() {} | |
1737 virtual ~RootWindowTestRotated() {} | |
1738 | |
1739 protected: | |
1740 virtual void SetUp() OVERRIDE { | |
1741 RootWindowTest::SetUp(); | |
1742 test_screen()->SetDisplayRotation(gfx::Display::ROTATE_90); | |
1743 } | |
1744 | |
1745 private: | |
1746 DISALLOW_COPY_AND_ASSIGN(RootWindowTestRotated); | |
1747 }; | |
1748 | |
1749 // Test how changing the bounds of the host window affects | |
1750 // Env::last_mouse_location(). | |
1751 TEST_F(RootWindowTestRotated, BoundsChanged) { | |
sadrul
2014/02/14 19:18:10
Could this be part of RootWindowTest, and you set
pkotwicz
2014/02/14 19:57:18
Ok
| |
1752 dispatcher()->host()->SetBounds(gfx::Rect(800, 600)); | |
1753 dispatcher()->MoveCursorTo(gfx::Point(40, 30)); | |
1754 EXPECT_EQ("40,30", Env::GetInstance()->last_mouse_location().ToString()); | |
1755 | |
1756 dispatcher()->host()->SetBounds(gfx::Rect(800, 500)); | |
1757 EXPECT_EQ("40,30", Env::GetInstance()->last_mouse_location().ToString()); | |
1758 } | |
1759 | |
1734 } // namespace aura | 1760 } // namespace aura |
OLD | NEW |