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/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 EXPECT_EQ(w1.get(), root->GetEventHandlerForPoint(gfx::Point(11, 11))); | 556 EXPECT_EQ(w1.get(), root->GetEventHandlerForPoint(gfx::Point(11, 11))); |
557 EXPECT_EQ(w11.get(), root->GetEventHandlerForPoint(gfx::Point(16, 16))); | 557 EXPECT_EQ(w11.get(), root->GetEventHandlerForPoint(gfx::Point(16, 16))); |
558 EXPECT_EQ(w111.get(), root->GetEventHandlerForPoint(gfx::Point(21, 21))); | 558 EXPECT_EQ(w111.get(), root->GetEventHandlerForPoint(gfx::Point(21, 21))); |
559 EXPECT_EQ(w1111.get(), root->GetEventHandlerForPoint(gfx::Point(26, 26))); | 559 EXPECT_EQ(w1111.get(), root->GetEventHandlerForPoint(gfx::Point(26, 26))); |
560 EXPECT_EQ(w12.get(), root->GetEventHandlerForPoint(gfx::Point(21, 431))); | 560 EXPECT_EQ(w12.get(), root->GetEventHandlerForPoint(gfx::Point(21, 431))); |
561 EXPECT_EQ(w121.get(), root->GetEventHandlerForPoint(gfx::Point(26, 436))); | 561 EXPECT_EQ(w121.get(), root->GetEventHandlerForPoint(gfx::Point(26, 436))); |
562 EXPECT_EQ(w13.get(), root->GetEventHandlerForPoint(gfx::Point(26, 481))); | 562 EXPECT_EQ(w13.get(), root->GetEventHandlerForPoint(gfx::Point(26, 481))); |
563 } | 563 } |
564 | 564 |
565 TEST_F(WindowTest, GetEventHandlerForPointWithOverride) { | 565 TEST_F(WindowTest, GetEventHandlerForPointWithOverride) { |
566 // If our child is flush to our top-left corner he gets events just inside the | 566 // If our child is flush to our top-left corner it gets events just inside the |
567 // window edges. | 567 // window edges. |
568 std::unique_ptr<Window> parent(CreateTestWindow( | 568 std::unique_ptr<Window> parent(CreateTestWindow( |
569 SK_ColorWHITE, 1, gfx::Rect(10, 20, 400, 500), root_window())); | 569 SK_ColorWHITE, 1, gfx::Rect(10, 20, 400, 500), root_window())); |
570 std::unique_ptr<Window> child( | 570 std::unique_ptr<Window> child( |
571 CreateTestWindow(SK_ColorRED, 2, gfx::Rect(0, 0, 60, 70), parent.get())); | 571 CreateTestWindow(SK_ColorRED, 2, gfx::Rect(0, 0, 60, 70), parent.get())); |
572 EXPECT_EQ(child.get(), parent->GetEventHandlerForPoint(gfx::Point(0, 0))); | 572 EXPECT_EQ(child.get(), parent->GetEventHandlerForPoint(gfx::Point(0, 0))); |
573 EXPECT_EQ(child.get(), parent->GetEventHandlerForPoint(gfx::Point(1, 1))); | 573 EXPECT_EQ(child.get(), parent->GetEventHandlerForPoint(gfx::Point(1, 1))); |
574 | 574 |
575 // We can override the hit test bounds of the parent to make the parent grab | 575 // We can override the hit test bounds of the parent to make the parent grab |
576 // events along that edge. | 576 // events along that edge. |
(...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2977 | 2977 |
2978 EXPECT_TRUE(animator.get()); | 2978 EXPECT_TRUE(animator.get()); |
2979 EXPECT_FALSE(animator->is_animating()); | 2979 EXPECT_FALSE(animator->is_animating()); |
2980 EXPECT_TRUE(observer.animation_completed()); | 2980 EXPECT_TRUE(observer.animation_completed()); |
2981 EXPECT_FALSE(observer.animation_aborted()); | 2981 EXPECT_FALSE(observer.animation_aborted()); |
2982 animator->RemoveObserver(&observer); | 2982 animator->RemoveObserver(&observer); |
2983 } | 2983 } |
2984 | 2984 |
2985 } // namespace test | 2985 } // namespace test |
2986 } // namespace aura | 2986 } // namespace aura |
OLD | NEW |