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/activation_controller.h" | 9 #include "ash/wm/activation_controller.h" |
10 #include "ash/wm/cursor_manager.h" | 10 #include "ash/wm/cursor_manager.h" |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 } | 457 } |
458 | 458 |
459 #if defined(OS_MACOSX) | 459 #if defined(OS_MACOSX) |
460 #define MAYBE_TransformActivate FAILS_TransformActivate | 460 #define MAYBE_TransformActivate FAILS_TransformActivate |
461 #else | 461 #else |
462 #define MAYBE_TransformActivate TransformActivate | 462 #define MAYBE_TransformActivate TransformActivate |
463 #endif | 463 #endif |
464 TEST_F(WindowManagerTest, MAYBE_TransformActivate) { | 464 TEST_F(WindowManagerTest, MAYBE_TransformActivate) { |
465 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); | 465 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); |
466 gfx::Size size = root_window->bounds().size(); | 466 gfx::Size size = root_window->bounds().size(); |
467 EXPECT_EQ( | 467 EXPECT_EQ(gfx::Rect(size).ToString(), |
468 gfx::Rect(size).ToString(), | 468 Shell::GetScreen()->GetDisplayNearestPoint( |
469 gfx::Screen::GetDisplayNearestPoint(gfx::Point()).bounds().ToString()); | 469 gfx::Point()).bounds().ToString()); |
470 | 470 |
471 // Rotate it clock-wise 90 degrees. | 471 // Rotate it clock-wise 90 degrees. |
472 ui::Transform transform; | 472 ui::Transform transform; |
473 transform.SetRotate(90.0f); | 473 transform.SetRotate(90.0f); |
474 transform.ConcatTranslate(size.width(), 0); | 474 transform.ConcatTranslate(size.width(), 0); |
475 root_window->SetTransform(transform); | 475 root_window->SetTransform(transform); |
476 | 476 |
477 test::TestActivationDelegate d1; | 477 test::TestActivationDelegate d1; |
478 aura::test::TestWindowDelegate wd; | 478 aura::test::TestWindowDelegate wd; |
479 scoped_ptr<aura::Window> w1( | 479 scoped_ptr<aura::Window> w1( |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 cursor_manager->ShowCursor(true); | 620 cursor_manager->ShowCursor(true); |
621 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 621 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
622 EXPECT_TRUE(cursor_manager->cursor_visible()); | 622 EXPECT_TRUE(cursor_manager->cursor_visible()); |
623 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); | 623 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); |
624 EXPECT_FALSE(cursor_manager->cursor_visible()); | 624 EXPECT_FALSE(cursor_manager->cursor_visible()); |
625 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 625 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
626 EXPECT_TRUE(cursor_manager->cursor_visible()); | 626 EXPECT_TRUE(cursor_manager->cursor_visible()); |
627 } | 627 } |
628 | 628 |
629 } // namespace ash | 629 } // namespace ash |
OLD | NEW |