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

Side by Side Diff: shell/shell_apptest.cc

Issue 1983263002: Replace ApplicationImpl::CreateApplicationConnector() with a standalone helper function. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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
« no previous file with comments | « mojo/ui/gl_view.cc ('k') | no next file » | 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 "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 EXPECT_EQ(app_url, connection_url); 217 EXPECT_EQ(app_url, connection_url);
218 EXPECT_EQ("hello", message); 218 EXPECT_EQ("hello", message);
219 base::MessageLoop::current()->Quit(); 219 base::MessageLoop::current()->Quit();
220 }; 220 };
221 pingable->Ping("hello", callback); 221 pingable->Ping("hello", callback);
222 base::RunLoop().Run(); 222 base::RunLoop().Run();
223 } 223 }
224 224
225 TEST_F(ShellAppTest, ApplicationConnector) { 225 TEST_F(ShellAppTest, ApplicationConnector) {
226 mojo::ApplicationConnectorPtr app_connector; 226 mojo::ApplicationConnectorPtr app_connector;
227 app_connector.Bind(application_impl()->CreateApplicationConnector()); 227 app_connector.Bind(
228 mojo::CreateApplicationConnector(application_impl()->shell()));
228 TestApplicationConnector(app_connector.get()); 229 TestApplicationConnector(app_connector.get());
229 } 230 }
230 231
231 TEST_F(ShellAppTest, ApplicationConnectorDuplicate) { 232 TEST_F(ShellAppTest, ApplicationConnectorDuplicate) {
232 mojo::ApplicationConnectorPtr app_connector1; 233 mojo::ApplicationConnectorPtr app_connector1;
233 app_connector1.Bind(application_impl()->CreateApplicationConnector()); 234 app_connector1.Bind(
235 mojo::CreateApplicationConnector(application_impl()->shell()));
234 { 236 {
235 SCOPED_TRACE("app_connector1"); 237 SCOPED_TRACE("app_connector1");
236 TestApplicationConnector(app_connector1.get()); 238 TestApplicationConnector(app_connector1.get());
237 } 239 }
238 240
239 mojo::ApplicationConnectorPtr app_connector2; 241 mojo::ApplicationConnectorPtr app_connector2;
240 app_connector1->Duplicate(GetProxy(&app_connector2)); 242 app_connector1->Duplicate(GetProxy(&app_connector2));
241 { 243 {
242 SCOPED_TRACE("app_connector2"); 244 SCOPED_TRACE("app_connector2");
243 TestApplicationConnector(app_connector2.get()); 245 TestApplicationConnector(app_connector2.get());
244 } 246 }
245 247
246 // The first one should still work. 248 // The first one should still work.
247 { 249 {
248 SCOPED_TRACE("app_connector1 again"); 250 SCOPED_TRACE("app_connector1 again");
249 TestApplicationConnector(app_connector1.get()); 251 TestApplicationConnector(app_connector1.get());
250 } 252 }
251 } 253 }
252 254
253 } // namespace 255 } // namespace
OLDNEW
« no previous file with comments | « mojo/ui/gl_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698