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

Side by Side Diff: ui/aura/test/aura_test_base.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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 | « ui/aura/single_monitor_manager.cc ('k') | ui/aura/test/test_screen.h » ('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 "ui/aura/test/aura_test_base.h" 5 #include "ui/aura/test/aura_test_base.h"
6 6
7 #include "ui/aura/env.h" 7 #include "ui/aura/env.h"
8 #include "ui/aura/monitor_manager.h" 8 #include "ui/aura/monitor_manager.h"
9 #include "ui/aura/root_window.h" 9 #include "ui/aura/root_window.h"
10 #include "ui/aura/single_monitor_manager.h" 10 #include "ui/aura/single_monitor_manager.h"
11 #include "ui/aura/test/test_screen.h"
11 #include "ui/aura/test/test_stacking_client.h" 12 #include "ui/aura/test/test_stacking_client.h"
12 #include "ui/aura/ui_controls_aura.h" 13 #include "ui/aura/ui_controls_aura.h"
13 #include "ui/base/gestures/gesture_configuration.h" 14 #include "ui/base/gestures/gesture_configuration.h"
15 #include "ui/gfx/screen.h"
14 #include "ui/ui_controls/ui_controls.h" 16 #include "ui/ui_controls/ui_controls.h"
15 17
16 #if defined(USE_ASH)
17 #include "ui/aura/test/test_screen.h"
18 #endif
19
20 namespace aura { 18 namespace aura {
21 namespace test { 19 namespace test {
22 20
23 AuraTestBase::AuraTestBase() { 21 AuraTestBase::AuraTestBase() {
24 } 22 }
25 23
26 AuraTestBase::~AuraTestBase() { 24 AuraTestBase::~AuraTestBase() {
27 } 25 }
28 26
29 void AuraTestBase::SetUp() { 27 void AuraTestBase::SetUp() {
(...skipping 16 matching lines...) Expand all
46 ui::GestureConfiguration::set_min_scroll_delta_squared(5 * 5); 44 ui::GestureConfiguration::set_min_scroll_delta_squared(5 * 5);
47 ui::GestureConfiguration:: 45 ui::GestureConfiguration::
48 set_min_touch_down_duration_in_seconds_for_click(0.01); 46 set_min_touch_down_duration_in_seconds_for_click(0.01);
49 ui::GestureConfiguration::set_points_buffered_for_velocity(10); 47 ui::GestureConfiguration::set_points_buffered_for_velocity(10);
50 ui::GestureConfiguration::set_rail_break_proportion(15); 48 ui::GestureConfiguration::set_rail_break_proportion(15);
51 ui::GestureConfiguration::set_rail_start_proportion(2); 49 ui::GestureConfiguration::set_rail_start_proportion(2);
52 50
53 Env::GetInstance()->SetMonitorManager(new SingleMonitorManager); 51 Env::GetInstance()->SetMonitorManager(new SingleMonitorManager);
54 root_window_.reset(Env::GetInstance()->monitor_manager()-> 52 root_window_.reset(Env::GetInstance()->monitor_manager()->
55 CreateRootWindowForPrimaryMonitor()); 53 CreateRootWindowForPrimaryMonitor());
56 #if defined(USE_ASH)
57 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); 54 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get()));
58 #endif
59 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get())); 55 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get()));
60 helper_.InitRootWindow(root_window()); 56 helper_.InitRootWindow(root_window());
61 helper_.SetUp(); 57 helper_.SetUp();
62 stacking_client_.reset(new TestStackingClient(root_window())); 58 stacking_client_.reset(new TestStackingClient(root_window()));
63 } 59 }
64 60
65 void AuraTestBase::TearDown() { 61 void AuraTestBase::TearDown() {
66 // Flush the message loop because we have pending release tasks 62 // Flush the message loop because we have pending release tasks
67 // and these tasks if un-executed would upset Valgrind. 63 // and these tasks if un-executed would upset Valgrind.
68 RunAllPendingInMessageLoop(); 64 RunAllPendingInMessageLoop();
69 65
70 stacking_client_.reset(); 66 stacking_client_.reset();
71 helper_.TearDown(); 67 helper_.TearDown();
72 root_window_.reset(); 68 root_window_.reset();
73 testing::Test::TearDown(); 69 testing::Test::TearDown();
74 } 70 }
75 71
76 void AuraTestBase::RunAllPendingInMessageLoop() { 72 void AuraTestBase::RunAllPendingInMessageLoop() {
77 helper_.RunAllPendingInMessageLoop(root_window()); 73 helper_.RunAllPendingInMessageLoop(root_window());
78 } 74 }
79 75
80 } // namespace test 76 } // namespace test
81 } // namespace aura 77 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/single_monitor_manager.cc ('k') | ui/aura/test/test_screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698