| 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/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 #include "ash/display/multi_display_manager.h" | 6 #include "ash/display/multi_display_manager.h" |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/wm/coordinate_conversion.h" | 10 #include "ash/wm/coordinate_conversion.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // Close system modal and so clicking a widget should work now. | 161 // Close system modal and so clicking a widget should work now. |
| 162 modal_widget->Close(); | 162 modal_widget->Close(); |
| 163 generator_1st.MoveMouseToCenterOf(widget_on_1st->GetNativeView()); | 163 generator_1st.MoveMouseToCenterOf(widget_on_1st->GetNativeView()); |
| 164 generator_1st.ClickLeftButton(); | 164 generator_1st.ClickLeftButton(); |
| 165 EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView())); | 165 EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView())); |
| 166 EXPECT_EQ(root_windows[0], Shell::GetActiveRootWindow()); | 166 EXPECT_EQ(root_windows[0], Shell::GetActiveRootWindow()); |
| 167 } | 167 } |
| 168 | 168 |
| 169 TEST_F(ExtendedDesktopTest, TestCursor) { | 169 TEST_F(ExtendedDesktopTest, TestCursor) { |
| 170 UpdateDisplay("1000x600,600x400"); | 170 UpdateDisplay("1000x600,600x400"); |
| 171 Shell::GetInstance()->cursor_manager()->ShowCursor(false); | |
| 172 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 171 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 173 EXPECT_FALSE(root_windows[0]->cursor_shown()); | |
| 174 EXPECT_FALSE(root_windows[1]->cursor_shown()); | |
| 175 Shell::GetInstance()->cursor_manager()->ShowCursor(true); | |
| 176 EXPECT_TRUE(root_windows[0]->cursor_shown()); | |
| 177 EXPECT_TRUE(root_windows[1]->cursor_shown()); | |
| 178 | |
| 179 EXPECT_EQ(ui::kCursorPointer, root_windows[0]->last_cursor().native_type()); | 172 EXPECT_EQ(ui::kCursorPointer, root_windows[0]->last_cursor().native_type()); |
| 180 EXPECT_EQ(ui::kCursorPointer, root_windows[1]->last_cursor().native_type()); | 173 EXPECT_EQ(ui::kCursorPointer, root_windows[1]->last_cursor().native_type()); |
| 181 Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorCopy); | 174 Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorCopy); |
| 182 EXPECT_EQ(ui::kCursorCopy, root_windows[0]->last_cursor().native_type()); | 175 EXPECT_EQ(ui::kCursorCopy, root_windows[0]->last_cursor().native_type()); |
| 183 EXPECT_EQ(ui::kCursorCopy, root_windows[1]->last_cursor().native_type()); | 176 EXPECT_EQ(ui::kCursorCopy, root_windows[1]->last_cursor().native_type()); |
| 184 } | 177 } |
| 185 | 178 |
| 186 TEST_F(ExtendedDesktopTest, TestCursorLocation) { | 179 TEST_F(ExtendedDesktopTest, TestCursorLocation) { |
| 187 UpdateDisplay("0+0-1000x600,1001+0-600x400"); | 180 UpdateDisplay("0+0-1000x600,1001+0-600x400"); |
| 188 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 181 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 EXPECT_EQ(root_windows[1], w1->GetNativeView()->GetRootWindow()); | 587 EXPECT_EQ(root_windows[1], w1->GetNativeView()->GetRootWindow()); |
| 595 | 588 |
| 596 // The widget should now move to the 1st root window without the property. | 589 // The widget should now move to the 1st root window without the property. |
| 597 w1->GetNativeView()->ClearProperty(internal::kStayInSameRootWindowKey); | 590 w1->GetNativeView()->ClearProperty(internal::kStayInSameRootWindowKey); |
| 598 w1->SetBounds(gfx::Rect(10, 10, 50, 50)); | 591 w1->SetBounds(gfx::Rect(10, 10, 50, 50)); |
| 599 EXPECT_EQ(root_windows[0], w1->GetNativeView()->GetRootWindow()); | 592 EXPECT_EQ(root_windows[0], w1->GetNativeView()->GetRootWindow()); |
| 600 } | 593 } |
| 601 | 594 |
| 602 } // namespace internal | 595 } // namespace internal |
| 603 } // namespace ash | 596 } // namespace ash |
| OLD | NEW |