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/test/ash_test_base.h" | 6 #include "ash/test/ash_test_base.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ui/aura/env.h" | 8 #include "ui/aura/env.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 protected: | 84 protected: |
85 std::unique_ptr<TooltipControllerTestHelper> helper_; | 85 std::unique_ptr<TooltipControllerTestHelper> helper_; |
86 | 86 |
87 private: | 87 private: |
88 DISALLOW_COPY_AND_ASSIGN(TooltipControllerTest); | 88 DISALLOW_COPY_AND_ASSIGN(TooltipControllerTest); |
89 }; | 89 }; |
90 | 90 |
91 TEST_F(TooltipControllerTest, NonNullTooltipClient) { | 91 TEST_F(TooltipControllerTest, NonNullTooltipClient) { |
92 EXPECT_TRUE(aura::client::GetTooltipClient(Shell::GetPrimaryRootWindow()) | 92 EXPECT_TRUE(aura::client::GetTooltipClient(Shell::GetPrimaryRootWindow()) != |
93 != NULL); | 93 NULL); |
94 EXPECT_EQ(base::string16(), helper_->GetTooltipText()); | 94 EXPECT_EQ(base::string16(), helper_->GetTooltipText()); |
95 EXPECT_EQ(NULL, helper_->GetTooltipWindow()); | 95 EXPECT_EQ(NULL, helper_->GetTooltipWindow()); |
96 EXPECT_FALSE(helper_->IsTooltipVisible()); | 96 EXPECT_FALSE(helper_->IsTooltipVisible()); |
97 } | 97 } |
98 | 98 |
99 TEST_F(TooltipControllerTest, HideTooltipWhenCursorHidden) { | 99 TEST_F(TooltipControllerTest, HideTooltipWhenCursorHidden) { |
100 std::unique_ptr<views::Widget> widget(CreateNewWidgetOn(0)); | 100 std::unique_ptr<views::Widget> widget(CreateNewWidgetOn(0)); |
101 TooltipTestView* view = new TooltipTestView; | 101 TooltipTestView* view = new TooltipTestView; |
102 AddViewToWidgetAndResize(widget.get(), view); | 102 AddViewToWidgetAndResize(widget.get(), view); |
103 view->set_tooltip_text(base::ASCIIToUTF16("Tooltip Text")); | 103 view->set_tooltip_text(base::ASCIIToUTF16("Tooltip Text")); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // be able to show tooltips on the primary display. | 168 // be able to show tooltips on the primary display. |
169 ui::test::EventGenerator generator1(root_windows[0]); | 169 ui::test::EventGenerator generator1(root_windows[0]); |
170 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), | 170 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), |
171 view1->bounds().CenterPoint()); | 171 view1->bounds().CenterPoint()); |
172 helper_->FireTooltipTimer(); | 172 helper_->FireTooltipTimer(); |
173 EXPECT_TRUE(helper_->IsTooltipVisible()); | 173 EXPECT_TRUE(helper_->IsTooltipVisible()); |
174 } | 174 } |
175 | 175 |
176 } // namespace test | 176 } // namespace test |
177 } // namespace ash | 177 } // namespace ash |
OLD | NEW |