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/shell.h" | 6 #include "ash/shell.h" |
7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "ash/tooltips/tooltip_controller.h" | 8 #include "ash/tooltips/tooltip_controller.h" |
9 #include "ash/wm/cursor_manager.h" | 9 #include "ash/wm/cursor_manager.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 FireTooltipTimer(); | 472 FireTooltipTimer(); |
473 EXPECT_TRUE(IsTooltipVisible()); | 473 EXPECT_TRUE(IsTooltipVisible()); |
474 EXPECT_TRUE(IsTooltipShownTimerRunning()); | 474 EXPECT_TRUE(IsTooltipShownTimerRunning()); |
475 string16 expected_tooltip = ASCIIToUTF16("Tooltip Text for view 2"); | 475 string16 expected_tooltip = ASCIIToUTF16("Tooltip Text for view 2"); |
476 EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(window)); | 476 EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(window)); |
477 EXPECT_EQ(expected_tooltip, GetTooltipText()); | 477 EXPECT_EQ(expected_tooltip, GetTooltipText()); |
478 EXPECT_EQ(window, GetTooltipWindow()); | 478 EXPECT_EQ(window, GetTooltipWindow()); |
479 } | 479 } |
480 | 480 |
481 TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) { | 481 TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) { |
482 internal::DisplayController::SetExtendedDesktopEnabled(true); | |
483 UpdateDisplay("1000x600,600x400"); | 482 UpdateDisplay("1000x600,600x400"); |
484 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 483 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
485 scoped_ptr<views::Widget> widget1(CreateNewWidgetWithBounds( | 484 scoped_ptr<views::Widget> widget1(CreateNewWidgetWithBounds( |
486 gfx::Rect(10, 10, 100, 100))); | 485 gfx::Rect(10, 10, 100, 100))); |
487 TooltipTestView* view1 = new TooltipTestView; | 486 TooltipTestView* view1 = new TooltipTestView; |
488 AddViewToWidgetAndResize(widget1.get(), view1); | 487 AddViewToWidgetAndResize(widget1.get(), view1); |
489 view1->set_tooltip_text(ASCIIToUTF16("Tooltip Text for view 1")); | 488 view1->set_tooltip_text(ASCIIToUTF16("Tooltip Text for view 1")); |
490 EXPECT_EQ(widget1->GetNativeView()->GetRootWindow(), root_windows[0]); | 489 EXPECT_EQ(widget1->GetNativeView()->GetRootWindow(), root_windows[0]); |
491 | 490 |
492 scoped_ptr<views::Widget> widget2(CreateNewWidgetWithBounds( | 491 scoped_ptr<views::Widget> widget2(CreateNewWidgetWithBounds( |
(...skipping 20 matching lines...) Expand all Loading... |
513 // be able to show tooltips on the primary display. | 512 // be able to show tooltips on the primary display. |
514 aura::test::EventGenerator generator1(root_windows[0]); | 513 aura::test::EventGenerator generator1(root_windows[0]); |
515 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), | 514 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), |
516 view1->bounds().CenterPoint()); | 515 view1->bounds().CenterPoint()); |
517 FireTooltipTimer(); | 516 FireTooltipTimer(); |
518 EXPECT_TRUE(IsTooltipVisible()); | 517 EXPECT_TRUE(IsTooltipVisible()); |
519 } | 518 } |
520 | 519 |
521 } // namespace test | 520 } // namespace test |
522 } // namespace ash | 521 } // namespace ash |
OLD | NEW |