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

Side by Side Diff: ash/mus/window_manager_unittest.cc

Issue 2804373002: Eliminate Connector::Connect(), Connection, etc. (Closed)
Patch Set: . Created 3 years, 8 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/window_manager_application.cc ('k') | chrome/app/mash/mash_runner.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <map> 5 #include <map>
6 #include <memory> 6 #include <memory>
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/public/interfaces/constants.mojom.h" 9 #include "ash/public/interfaces/constants.mojom.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 TEST_F(MusWindowManagerTest, OpenWindow) { 81 TEST_F(MusWindowManagerTest, OpenWindow) {
82 display::ScreenBase screen; 82 display::ScreenBase screen;
83 screen.display_list().AddDisplay( 83 screen.display_list().AddDisplay(
84 display::Display(1, gfx::Rect(0, 0, 200, 200)), 84 display::Display(1, gfx::Rect(0, 0, 200, 200)),
85 display::DisplayList::Type::PRIMARY); 85 display::DisplayList::Type::PRIMARY);
86 display::Screen::SetScreenInstance(&screen); 86 display::Screen::SetScreenInstance(&screen);
87 87
88 WindowTreeClientDelegate window_tree_delegate; 88 WindowTreeClientDelegate window_tree_delegate;
89 89
90 connector()->Connect(mojom::kServiceName); 90 connector()->StartService(mojom::kServiceName);
91 91
92 // Connect to mus and create a new top level window. The request goes to 92 // Connect to mus and create a new top level window. The request goes to
93 // |ash|, but is async. 93 // |ash|, but is async.
94 aura::WindowTreeClient client(connector(), &window_tree_delegate, nullptr, 94 aura::WindowTreeClient client(connector(), &window_tree_delegate, nullptr,
95 nullptr, nullptr, false); 95 nullptr, nullptr, false);
96 client.ConnectViaWindowTreeFactory(); 96 client.ConnectViaWindowTreeFactory();
97 aura::test::EnvTestHelper().SetWindowTreeClient(&client); 97 aura::test::EnvTestHelper().SetWindowTreeClient(&client);
98 std::map<std::string, std::vector<uint8_t>> properties; 98 std::map<std::string, std::vector<uint8_t>> properties;
99 properties[ui::mojom::WindowManager::kWindowType_InitProperty] = 99 properties[ui::mojom::WindowManager::kWindowType_InitProperty] =
100 mojo::ConvertTo<std::vector<uint8_t>>( 100 mojo::ConvertTo<std::vector<uint8_t>>(
(...skipping 13 matching lines...) Expand all
114 aura::WindowTreeClient child_client(connector(), &window_tree_delegate, 114 aura::WindowTreeClient child_client(connector(), &window_tree_delegate,
115 nullptr, std::move(tree_client_request), 115 nullptr, std::move(tree_client_request),
116 nullptr, false); 116 nullptr, false);
117 window_tree_delegate.WaitForEmbed(); 117 window_tree_delegate.WaitForEmbed();
118 ASSERT_TRUE(!child_client.GetRoots().empty()); 118 ASSERT_TRUE(!child_client.GetRoots().empty());
119 window_tree_delegate.DestroyWindowTreeHost(); 119 window_tree_delegate.DestroyWindowTreeHost();
120 } 120 }
121 121
122 } // namespace mus 122 } // namespace mus
123 } // namespace ash 123 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/window_manager_application.cc ('k') | chrome/app/mash/mash_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698