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

Side by Side Diff: ash/mus/test/wm_test_helper.cc

Issue 2029883002: Moves mash/wm into ash/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_static_assert
Patch Set: move comment Created 4 years, 6 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/mus/test/wm_test_helper.h ('k') | ash/mus/test/wm_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 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 "mash/wm/test/wm_test_helper.h" 5 #include "ash/mus/test/wm_test_helper.h"
6 6
7 #include "ash/mus/root_window_controller.h"
8 #include "ash/mus/test/wm_test_screen.h"
9 #include "ash/mus/window_manager.h"
10 #include "ash/mus/window_manager_application.h"
7 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
8 #include "components/mus/public/cpp/property_type_converters.h" 12 #include "components/mus/public/cpp/property_type_converters.h"
9 #include "components/mus/public/cpp/window_tree_client.h" 13 #include "components/mus/public/cpp/window_tree_client.h"
10 #include "mash/wm/root_window_controller.h"
11 #include "mash/wm/test/wm_test_screen.h"
12 #include "mash/wm/window_manager.h"
13 #include "mash/wm/window_manager.h"
14 #include "mash/wm/window_manager_application.h"
15 #include "ui/display/display.h" 14 #include "ui/display/display.h"
16 15
17 namespace mash { 16 namespace ash {
18 namespace wm { 17 namespace mus {
19 18
20 WmTestHelper::WmTestHelper() {} 19 WmTestHelper::WmTestHelper() {}
21 20
22 WmTestHelper::~WmTestHelper() {} 21 WmTestHelper::~WmTestHelper() {}
23 22
24 void WmTestHelper::Init() { 23 void WmTestHelper::Init() {
25 message_loop_.reset(new base::MessageLoopForUI()); 24 message_loop_.reset(new base::MessageLoopForUI());
26 const uint32_t app_id = 1; 25 const uint32_t app_id = 1;
27 window_manager_app_.Initialize(nullptr, shell::Identity(), app_id); 26 window_manager_app_.Initialize(nullptr, shell::Identity(), app_id);
28 screen_ = new WmTestScreen; 27 screen_ = new WmTestScreen;
29 window_manager_app_.screen_.reset(screen_); 28 window_manager_app_.screen_.reset(screen_);
30 29
31 // RootWindowController controls its own lifetime. 30 // RootWindowController controls its own lifetime.
32 RootWindowController* root_window_controller = 31 RootWindowController* root_window_controller =
33 new RootWindowController(&window_manager_app_); 32 new RootWindowController(&window_manager_app_);
34 // Need an id other than kInvalidDisplayID so the Display is considered valid. 33 // Need an id other than kInvalidDisplayID so the Display is considered valid.
35 root_window_controller->display_.set_id(1); 34 root_window_controller->display_.set_id(1);
36 const gfx::Rect display_bounds(0, 0, 800, 600); 35 const gfx::Rect display_bounds(0, 0, 800, 600);
37 root_window_controller->display_.set_bounds(display_bounds); 36 root_window_controller->display_.set_bounds(display_bounds);
38 // Offset the height slightly to give a different work area. -20 is arbitrary, 37 // Offset the height slightly to give a different work area. -20 is arbitrary,
39 // it could be anything. 38 // it could be anything.
40 const gfx::Rect work_area(0, 0, display_bounds.width(), 39 const gfx::Rect work_area(0, 0, display_bounds.width(),
41 display_bounds.height() - 20); 40 display_bounds.height() - 20);
42 root_window_controller->display_.set_work_area(work_area); 41 root_window_controller->display_.set_work_area(work_area);
43 42
44 screen_->display_list()->AddDisplay(root_window_controller->display(), 43 screen_->display_list()->AddDisplay(root_window_controller->display(),
45 views::DisplayList::Type::PRIMARY); 44 views::DisplayList::Type::PRIMARY);
46 45
47 window_tree_client_setup_.Init( 46 window_tree_client_setup_.Init(root_window_controller,
48 root_window_controller, root_window_controller->window_manager_.get()); 47 root_window_controller->window_manager_.get());
49 root_window_controller->root()->SetBounds(display_bounds); 48 root_window_controller->root()->SetBounds(display_bounds);
50 window_manager_app_.AddRootWindowController(root_window_controller); 49 window_manager_app_.AddRootWindowController(root_window_controller);
51 } 50 }
52 51
53 } // namespace wm 52 } // namespace mus
54 } // namespace mash 53 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/test/wm_test_helper.h ('k') | ash/mus/test/wm_test_screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698