Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: ash/tooltips/tooltip_controller_unittest.cc

Issue 2653593004: chromeos: Remove AshTestBase::SupportsMultipleDisplays (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/test/ash_test_impl_aura.cc ('k') | ash/touch/touch_observer_hud_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // Show the cursor and re-check. 121 // Show the cursor and re-check.
122 RunAllPendingInMessageLoop(); 122 RunAllPendingInMessageLoop();
123 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); 123 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
124 RunAllPendingInMessageLoop(); 124 RunAllPendingInMessageLoop();
125 helper_->FireTooltipTimer(); 125 helper_->FireTooltipTimer();
126 EXPECT_TRUE(helper_->IsTooltipVisible()); 126 EXPECT_TRUE(helper_->IsTooltipVisible());
127 } 127 }
128 128
129 TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) { 129 TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) {
130 if (!SupportsMultipleDisplays())
131 return;
132
133 UpdateDisplay("1000x600,600x400"); 130 UpdateDisplay("1000x600,600x400");
134 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 131 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
135 std::unique_ptr<views::Widget> widget1( 132 std::unique_ptr<views::Widget> widget1(
136 CreateNewWidgetWithBoundsOn(0, gfx::Rect(10, 10, 100, 100))); 133 CreateNewWidgetWithBoundsOn(0, gfx::Rect(10, 10, 100, 100)));
137 TooltipTestView* view1 = new TooltipTestView; 134 TooltipTestView* view1 = new TooltipTestView;
138 AddViewToWidgetAndResize(widget1.get(), view1); 135 AddViewToWidgetAndResize(widget1.get(), view1);
139 view1->set_tooltip_text(base::ASCIIToUTF16("Tooltip Text for view 1")); 136 view1->set_tooltip_text(base::ASCIIToUTF16("Tooltip Text for view 1"));
140 EXPECT_EQ(widget1->GetNativeView()->GetRootWindow(), root_windows[0]); 137 EXPECT_EQ(widget1->GetNativeView()->GetRootWindow(), root_windows[0]);
141 138
142 std::unique_ptr<views::Widget> widget2( 139 std::unique_ptr<views::Widget> widget2(
(...skipping 20 matching lines...) Expand all
163 // be able to show tooltips on the primary display. 160 // be able to show tooltips on the primary display.
164 ui::test::EventGenerator generator1(root_windows[0]); 161 ui::test::EventGenerator generator1(root_windows[0]);
165 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), 162 generator1.MoveMouseRelativeTo(widget1->GetNativeView(),
166 view1->bounds().CenterPoint()); 163 view1->bounds().CenterPoint());
167 helper_->FireTooltipTimer(); 164 helper_->FireTooltipTimer();
168 EXPECT_TRUE(helper_->IsTooltipVisible()); 165 EXPECT_TRUE(helper_->IsTooltipVisible());
169 } 166 }
170 167
171 } // namespace test 168 } // namespace test
172 } // namespace ash 169 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_impl_aura.cc ('k') | ash/touch/touch_observer_hud_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698