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

Side by Side Diff: ash/test/ash_test_impl_aura.cc

Issue 2445583002: Relocate display_manager from ash to ui (Closed)
Patch Set: fix windows build Created 4 years, 1 month 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_helper.cc ('k') | ash/test/display_manager_test_api.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/test/ash_test_impl_aura.h" 5 #include "ash/test/ash_test_impl_aura.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/test/ash_test.h" 8 #include "ash/common/test/ash_test.h"
9 #include "ash/display/display_manager.h"
10 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
11 #include "ash/shell.h" 10 #include "ash/shell.h"
12 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
13 #include "ash/test/display_manager_test_api.h"
14 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
15 #include "ui/aura/test/test_window_delegate.h" 13 #include "ui/aura/test/test_window_delegate.h"
16 #include "ui/display/manager/display_layout.h" 14 #include "ui/display/manager/display_layout.h"
15 #include "ui/display/manager/display_manager.h"
17 #include "ui/display/screen.h" 16 #include "ui/display/screen.h"
17 #include "ui/display/test/display_manager_test_api.h"
18 #include "ui/wm/core/window_util.h" 18 #include "ui/wm/core/window_util.h"
19 19
20 namespace ash { 20 namespace ash {
21 namespace { 21 namespace {
22 22
23 // AshTestBase is abstract as TestBody() is pure virtual (the various TEST 23 // AshTestBase is abstract as TestBody() is pure virtual (the various TEST
24 // macros have the implementation). In order to create AshTestBase we have to 24 // macros have the implementation). In order to create AshTestBase we have to
25 // subclass with an empty implementation of TestBody(). That's ok as the class 25 // subclass with an empty implementation of TestBody(). That's ok as the class
26 // isn't used as a normal test here. 26 // isn't used as a normal test here.
27 class AshTestBaseImpl : public test::AshTestBase { 27 class AshTestBaseImpl : public test::AshTestBase {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 display::Display AshTestImplAura::GetSecondaryDisplay() { 82 display::Display AshTestImplAura::GetSecondaryDisplay() {
83 return Shell::GetInstance()->display_manager()->GetSecondaryDisplay(); 83 return Shell::GetInstance()->display_manager()->GetSecondaryDisplay();
84 } 84 }
85 85
86 bool AshTestImplAura::SetSecondaryDisplayPlacement( 86 bool AshTestImplAura::SetSecondaryDisplayPlacement(
87 display::DisplayPlacement::Position position, 87 display::DisplayPlacement::Position position,
88 int offset) { 88 int offset) {
89 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( 89 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
90 test::CreateDisplayLayout(Shell::GetInstance()->display_manager(), 90 display::test::CreateDisplayLayout(
91 position, 0)); 91 Shell::GetInstance()->display_manager(), position, 0));
92 return true; 92 return true;
93 } 93 }
94 94
95 void AshTestImplAura::ConfigureWidgetInitParamsForDisplay( 95 void AshTestImplAura::ConfigureWidgetInitParamsForDisplay(
96 WmWindow* window, 96 WmWindow* window,
97 views::Widget::InitParams* init_params) { 97 views::Widget::InitParams* init_params) {
98 init_params->context = WmWindowAura::GetAuraWindow(window); 98 init_params->context = WmWindowAura::GetAuraWindow(window);
99 } 99 }
100 100
101 void AshTestImplAura::AddTransientChild(WmWindow* parent, WmWindow* window) { 101 void AshTestImplAura::AddTransientChild(WmWindow* parent, WmWindow* window) {
102 ::wm::AddTransientChild(WmWindowAura::GetAuraWindow(parent), 102 ::wm::AddTransientChild(WmWindowAura::GetAuraWindow(parent),
103 WmWindowAura::GetAuraWindow(window)); 103 WmWindowAura::GetAuraWindow(window));
104 } 104 }
105 105
106 // static 106 // static
107 std::unique_ptr<AshTestImpl> AshTestImpl::Create() { 107 std::unique_ptr<AshTestImpl> AshTestImpl::Create() {
108 return base::MakeUnique<AshTestImplAura>(); 108 return base::MakeUnique<AshTestImplAura>();
109 } 109 }
110 110
111 } // namespace ash 111 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_helper.cc ('k') | ash/test/display_manager_test_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698