| 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 "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 #include "ash/shell_window_ids.h" | 6 #include "ash/shell_window_ids.h" |
| 7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
| 8 #include "ash/test/test_activation_delegate.h" | 8 #include "ash/test/test_activation_delegate.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "ui/aura/client/cursor_client_observer.h" | 10 #include "ui/aura/client/cursor_client_observer.h" |
| 11 #include "ui/aura/client/focus_client.h" | 11 #include "ui/aura/client/focus_client.h" |
| 12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 13 #include "ui/aura/test/aura_test_base.h" | 13 #include "ui/aura/test/aura_test_base.h" |
| 14 #include "ui/aura/test/test_window_delegate.h" | 14 #include "ui/aura/test/test_window_delegate.h" |
| 15 #include "ui/aura/test/test_windows.h" | 15 #include "ui/aura/test/test_windows.h" |
| 16 #include "ui/base/cursor/cursor.h" | 16 #include "ui/base/cursor/cursor.h" |
| 17 #include "ui/base/hit_test.h" | 17 #include "ui/base/hit_test.h" |
| 18 #include "ui/display/screen.h" |
| 18 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
| 19 #include "ui/events/event_processor.h" | 20 #include "ui/events/event_processor.h" |
| 20 #include "ui/events/event_utils.h" | 21 #include "ui/events/event_utils.h" |
| 21 #include "ui/events/test/event_generator.h" | 22 #include "ui/events/test/event_generator.h" |
| 22 #include "ui/events/test/test_event_handler.h" | 23 #include "ui/events/test/test_event_handler.h" |
| 23 #include "ui/gfx/screen.h" | |
| 24 #include "ui/wm/core/compound_event_filter.h" | 24 #include "ui/wm/core/compound_event_filter.h" |
| 25 #include "ui/wm/public/activation_client.h" | 25 #include "ui/wm/public/activation_client.h" |
| 26 #include "ui/wm/public/activation_delegate.h" | 26 #include "ui/wm/public/activation_delegate.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 class TestingCursorClientObserver : public aura::client::CursorClientObserver { | 30 class TestingCursorClientObserver : public aura::client::CursorClientObserver { |
| 31 public: | 31 public: |
| 32 TestingCursorClientObserver() | 32 TestingCursorClientObserver() |
| 33 : cursor_visibility_(false), | 33 : cursor_visibility_(false), |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 | 594 |
| 595 #if defined(OS_WIN) | 595 #if defined(OS_WIN) |
| 596 #define MAYBE_TransformActivate DISABLED_TransformActivate | 596 #define MAYBE_TransformActivate DISABLED_TransformActivate |
| 597 #else | 597 #else |
| 598 #define MAYBE_TransformActivate TransformActivate | 598 #define MAYBE_TransformActivate TransformActivate |
| 599 #endif | 599 #endif |
| 600 TEST_F(WindowManagerTest, MAYBE_TransformActivate) { | 600 TEST_F(WindowManagerTest, MAYBE_TransformActivate) { |
| 601 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 601 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
| 602 gfx::Size size = root_window->bounds().size(); | 602 gfx::Size size = root_window->bounds().size(); |
| 603 EXPECT_EQ(gfx::Rect(size).ToString(), | 603 EXPECT_EQ(gfx::Rect(size).ToString(), |
| 604 gfx::Screen::GetScreen() | 604 display::Screen::GetScreen() |
| 605 ->GetDisplayNearestPoint(gfx::Point()) | 605 ->GetDisplayNearestPoint(gfx::Point()) |
| 606 .bounds() | 606 .bounds() |
| 607 .ToString()); | 607 .ToString()); |
| 608 | 608 |
| 609 // Rotate it clock-wise 90 degrees. | 609 // Rotate it clock-wise 90 degrees. |
| 610 gfx::Transform transform; | 610 gfx::Transform transform; |
| 611 transform.Translate(size.width(), 0); | 611 transform.Translate(size.width(), 0); |
| 612 transform.Rotate(90.0f); | 612 transform.Rotate(90.0f); |
| 613 root_window->GetHost()->SetRootTransform(transform); | 613 root_window->GetHost()->SetRootTransform(transform); |
| 614 | 614 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 generator.MoveMouseTo(50, 50); | 850 generator.MoveMouseTo(50, 50); |
| 851 EXPECT_TRUE(observer_a.did_visibility_change()); | 851 EXPECT_TRUE(observer_a.did_visibility_change()); |
| 852 EXPECT_FALSE(observer_b.did_visibility_change()); | 852 EXPECT_FALSE(observer_b.did_visibility_change()); |
| 853 EXPECT_TRUE(observer_a.is_cursor_visible()); | 853 EXPECT_TRUE(observer_a.is_cursor_visible()); |
| 854 | 854 |
| 855 cursor_manager->RemoveObserver(&observer_a); | 855 cursor_manager->RemoveObserver(&observer_a); |
| 856 } | 856 } |
| 857 #endif // defined(OS_CHROMEOS) | 857 #endif // defined(OS_CHROMEOS) |
| 858 | 858 |
| 859 } // namespace ash | 859 } // namespace ash |
| OLD | NEW |