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

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

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ash/sticky_keys/sticky_keys_overlay.cc ('k') | ash/touch/touch_observer_hud.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/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
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
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
OLDNEW
« no previous file with comments | « ash/sticky_keys/sticky_keys_overlay.cc ('k') | ash/touch/touch_observer_hud.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698