| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // Show tooltip on second display. | 149 // Show tooltip on second display. |
| 150 ui::test::EventGenerator generator(root_windows[1]); | 150 ui::test::EventGenerator generator(root_windows[1]); |
| 151 generator.MoveMouseRelativeTo(widget2->GetNativeView(), | 151 generator.MoveMouseRelativeTo(widget2->GetNativeView(), |
| 152 view2->bounds().CenterPoint()); | 152 view2->bounds().CenterPoint()); |
| 153 helper_->FireTooltipTimer(); | 153 helper_->FireTooltipTimer(); |
| 154 EXPECT_TRUE(helper_->IsTooltipVisible()); | 154 EXPECT_TRUE(helper_->IsTooltipVisible()); |
| 155 | 155 |
| 156 // Get rid of secondary display. This destroy's the tooltip's aura window. If | 156 // Get rid of secondary display. This destroy's the tooltip's aura window. If |
| 157 // we have handled this case, we will not crash in the following statement. | 157 // we have handled this case, we will not crash in the following statement. |
| 158 UpdateDisplay("1000x600"); | 158 UpdateDisplay("1000x600"); |
| 159 #if !defined(OS_WIN) | |
| 160 // TODO(cpu): Detangle the window destruction notification. Currently | |
| 161 // the TooltipController::OnWindowDestroyed is not being called then the | |
| 162 // display is torn down so the tooltip is is still there. | |
| 163 EXPECT_FALSE(helper_->IsTooltipVisible()); | 159 EXPECT_FALSE(helper_->IsTooltipVisible()); |
| 164 #endif | |
| 165 EXPECT_EQ(widget2->GetNativeView()->GetRootWindow(), root_windows[0]); | 160 EXPECT_EQ(widget2->GetNativeView()->GetRootWindow(), root_windows[0]); |
| 166 | 161 |
| 167 // The tooltip should create a new aura window for itself, so we should still | 162 // The tooltip should create a new aura window for itself, so we should still |
| 168 // be able to show tooltips on the primary display. | 163 // be able to show tooltips on the primary display. |
| 169 ui::test::EventGenerator generator1(root_windows[0]); | 164 ui::test::EventGenerator generator1(root_windows[0]); |
| 170 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), | 165 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), |
| 171 view1->bounds().CenterPoint()); | 166 view1->bounds().CenterPoint()); |
| 172 helper_->FireTooltipTimer(); | 167 helper_->FireTooltipTimer(); |
| 173 EXPECT_TRUE(helper_->IsTooltipVisible()); | 168 EXPECT_TRUE(helper_->IsTooltipVisible()); |
| 174 } | 169 } |
| 175 | 170 |
| 176 } // namespace test | 171 } // namespace test |
| 177 } // namespace ash | 172 } // namespace ash |
| OLD | NEW |