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/test/event_generator.h" | 9 #include "ui/aura/test/event_generator.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 namespace { | 32 namespace { |
33 | 33 |
34 views::Widget* CreateNewWidgetWithBoundsOn(int display, | 34 views::Widget* CreateNewWidgetWithBoundsOn(int display, |
35 const gfx::Rect& bounds) { | 35 const gfx::Rect& bounds) { |
36 views::Widget* widget = new views::Widget; | 36 views::Widget* widget = new views::Widget; |
37 views::Widget::InitParams params; | 37 views::Widget::InitParams params; |
38 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; | 38 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; |
39 params.accept_events = true; | 39 params.accept_events = true; |
40 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 40 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
41 params.context = Shell::GetAllRootWindows().at(display); | 41 params.context = Shell::GetAllRootWindows().at(display); |
42 params.child = true; | |
43 params.bounds = bounds; | 42 params.bounds = bounds; |
44 widget->Init(params); | 43 widget->Init(params); |
45 widget->Show(); | 44 widget->Show(); |
46 return widget; | 45 return widget; |
47 } | 46 } |
48 | 47 |
49 views::Widget* CreateNewWidgetOn(int display) { | 48 views::Widget* CreateNewWidgetOn(int display) { |
50 return CreateNewWidgetWithBoundsOn(display, gfx::Rect()); | 49 return CreateNewWidgetWithBoundsOn(display, gfx::Rect()); |
51 } | 50 } |
52 | 51 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // be able to show tooltips on the primary display. | 169 // be able to show tooltips on the primary display. |
171 aura::test::EventGenerator generator1(root_windows[0]); | 170 aura::test::EventGenerator generator1(root_windows[0]); |
172 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), | 171 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), |
173 view1->bounds().CenterPoint()); | 172 view1->bounds().CenterPoint()); |
174 helper_->FireTooltipTimer(); | 173 helper_->FireTooltipTimer(); |
175 EXPECT_TRUE(helper_->IsTooltipVisible()); | 174 EXPECT_TRUE(helper_->IsTooltipVisible()); |
176 } | 175 } |
177 | 176 |
178 } // namespace test | 177 } // namespace test |
179 } // namespace ash | 178 } // namespace ash |
OLD | NEW |