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

Side by Side Diff: services/http_server/http_server_apptest.cc

Issue 1915403002: ApplicationImpl::ConnectToServiceDeprecated() -> mojo::ConnectToService() conversion, part 2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh Created 4 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 | « services/files/files_test_base.cc ('k') | services/http_server/http_server_impl.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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "mojo/data_pipe_utils/data_pipe_utils.h" 8 #include "mojo/data_pipe_utils/data_pipe_utils.h"
9 #include "mojo/public/cpp/application/application_impl.h" 9 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/public/cpp/application/application_test_base.h" 10 #include "mojo/public/cpp/application/application_test_base.h"
11 #include "mojo/public/cpp/application/connect.h"
11 #include "mojo/public/cpp/system/macros.h" 12 #include "mojo/public/cpp/system/macros.h"
12 #include "mojo/services/http_server/cpp/http_server_util.h" 13 #include "mojo/services/http_server/cpp/http_server_util.h"
13 #include "mojo/services/http_server/interfaces/http_server.mojom.h" 14 #include "mojo/services/http_server/interfaces/http_server.mojom.h"
14 #include "mojo/services/http_server/interfaces/http_server_factory.mojom.h" 15 #include "mojo/services/http_server/interfaces/http_server_factory.mojom.h"
15 #include "mojo/services/network/interfaces/net_address.mojom.h" 16 #include "mojo/services/network/interfaces/net_address.mojom.h"
16 #include "mojo/services/network/interfaces/network_service.mojom.h" 17 #include "mojo/services/network/interfaces/network_service.mojom.h"
17 #include "mojo/services/network/interfaces/url_loader.mojom.h" 18 #include "mojo/services/network/interfaces/url_loader.mojom.h"
18 19
19 namespace http_server { 20 namespace http_server {
20 21
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 class HttpServerApplicationTest : public mojo::test::ApplicationTestBase { 91 class HttpServerApplicationTest : public mojo::test::ApplicationTestBase {
91 public: 92 public:
92 HttpServerApplicationTest() : ApplicationTestBase() {} 93 HttpServerApplicationTest() : ApplicationTestBase() {}
93 ~HttpServerApplicationTest() override {} 94 ~HttpServerApplicationTest() override {}
94 95
95 protected: 96 protected:
96 // ApplicationTestBase: 97 // ApplicationTestBase:
97 void SetUp() override { 98 void SetUp() override {
98 ApplicationTestBase::SetUp(); 99 ApplicationTestBase::SetUp();
99 100
100 application_impl()->ConnectToServiceDeprecated("mojo:http_server", 101 mojo::ConnectToService(application_impl()->shell(), "mojo:http_server",
101 &http_server_factory_); 102 GetProxy(&http_server_factory_));
102 application_impl()->ConnectToServiceDeprecated("mojo:network_service", 103 mojo::ConnectToService(application_impl()->shell(), "mojo:network_service",
103 &network_service_); 104 GetProxy(&network_service_));
104 } 105 }
105 106
106 http_server::HttpServerPtr CreateHttpServer(); 107 http_server::HttpServerPtr CreateHttpServer();
107 108
108 http_server::HttpServerFactoryPtr http_server_factory_; 109 http_server::HttpServerFactoryPtr http_server_factory_;
109 mojo::NetworkServicePtr network_service_; 110 mojo::NetworkServicePtr network_service_;
110 111
111 private: 112 private:
112 MOJO_DISALLOW_COPY_AND_ASSIGN(HttpServerApplicationTest); 113 MOJO_DISALLOW_COPY_AND_ASSIGN(HttpServerApplicationTest);
113 }; 114 };
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 url_request->method = "POST"; 189 url_request->method = "POST";
189 url_request->body.resize(1); 190 url_request->body.resize(1);
190 WriteMessageToDataPipe(kExampleMessage, &url_request->body[0]); 191 WriteMessageToDataPipe(kExampleMessage, &url_request->body[0]);
191 192
192 url_loader->Start(url_request.Pass(), base::Bind(&CheckServerResponse)); 193 url_loader->Start(url_request.Pass(), base::Bind(&CheckServerResponse));
193 base::RunLoop run_loop; 194 base::RunLoop run_loop;
194 run_loop.Run(); 195 run_loop.Run();
195 } 196 }
196 197
197 } // namespace http_server 198 } // namespace http_server
OLDNEW
« no previous file with comments | « services/files/files_test_base.cc ('k') | services/http_server/http_server_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698