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

Side by Side Diff: services/window_manager/window_manager_api_unittest.cc

Issue 858103002: Remove [Client=] annotation from ServiceProvider (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase for trybots (no code changes from ps2) Created 5 years, 11 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 | « services/window_manager/main.cc ('k') | services/window_manager/window_manager_app.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "mojo/public/cpp/application/application_delegate.h" 9 #include "mojo/public/cpp/application/application_delegate.h"
10 #include "mojo/public/cpp/application/application_impl.h" 10 #include "mojo/public/cpp/application/application_impl.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 bool ConfigureIncomingConnection( 102 bool ConfigureIncomingConnection(
103 mojo::ApplicationConnection* connection) override { 103 mojo::ApplicationConnection* connection) override {
104 connection->AddService(view_manager_client_factory_.get()); 104 connection->AddService(view_manager_client_factory_.get());
105 return true; 105 return true;
106 } 106 }
107 107
108 // Overridden from mojo::ViewManagerDelegate: 108 // Overridden from mojo::ViewManagerDelegate:
109 void OnEmbed(View* root, 109 void OnEmbed(View* root,
110 mojo::ServiceProviderImpl* exported_services, 110 mojo::InterfaceRequest<mojo::ServiceProvider> services,
111 scoped_ptr<mojo::ServiceProvider> imported_services) override { 111 mojo::ServiceProviderPtr exposed_services) override {
112 root_added_callback_.Run(root); 112 root_added_callback_.Run(root);
113 } 113 }
114 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override {} 114 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override {}
115 115
116 RootAddedCallback root_added_callback_; 116 RootAddedCallback root_added_callback_;
117 117
118 ScopedVector<ApplicationImpl> apps_; 118 ScopedVector<ApplicationImpl> apps_;
119 scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_; 119 scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_;
120 120
121 DISALLOW_COPY_AND_ASSIGN(TestApplicationLoader); 121 DISALLOW_COPY_AND_ASSIGN(TestApplicationLoader);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 run_loop.Run(); 159 run_loop.Run();
160 return old_and_new; 160 return old_and_new;
161 } 161 }
162 162
163 Id OpenWindow() { 163 Id OpenWindow() {
164 return OpenWindowWithURL(kTestServiceURL); 164 return OpenWindowWithURL(kTestServiceURL);
165 } 165 }
166 166
167 Id OpenWindowWithURL(const std::string& url) { 167 Id OpenWindowWithURL(const std::string& url) {
168 base::RunLoop run_loop; 168 base::RunLoop run_loop;
169 mojo::ServiceProviderPtr sp; 169 window_manager_->Embed(url, nullptr, nullptr);
170 BindToProxy(new mojo::ServiceProviderImpl, &sp);
171 window_manager_->Embed(
172 url, mojo::MakeRequest<mojo::ServiceProvider>(sp.PassMessagePipe()));
173 run_loop.Run(); 170 run_loop.Run();
174 return WaitForEmbed(); 171 return WaitForEmbed();
175 } 172 }
176 173
177 TestWindowManagerClient* window_manager_client() { 174 TestWindowManagerClient* window_manager_client() {
178 return window_manager_client_.get(); 175 return window_manager_client_.get();
179 } 176 }
180 177
181 mojo::WindowManagerPtr window_manager_; 178 mojo::WindowManagerPtr window_manager_;
182 179
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 258
262 Id second_window = OpenWindow(); 259 Id second_window = OpenWindow();
263 window_manager_->ActivateWindow(second_window, 260 window_manager_->ActivateWindow(second_window,
264 base::Bind(&EmptyResultCallback)); 261 base::Bind(&EmptyResultCallback));
265 ids = WaitForActiveWindowChange(); 262 ids = WaitForActiveWindowChange();
266 EXPECT_EQ(ids.first, first_window); 263 EXPECT_EQ(ids.first, first_window);
267 EXPECT_EQ(ids.second, second_window); 264 EXPECT_EQ(ids.second, second_window);
268 } 265 }
269 266
270 } // namespace window_manager 267 } // namespace window_manager
OLDNEW
« no previous file with comments | « services/window_manager/main.cc ('k') | services/window_manager/window_manager_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698