| OLD | NEW | 
|    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" | 
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   90 class HttpServerApplicationTest : public mojo::test::ApplicationTestBase { |   90 class HttpServerApplicationTest : public mojo::test::ApplicationTestBase { | 
|   91  public: |   91  public: | 
|   92   HttpServerApplicationTest() : ApplicationTestBase() {} |   92   HttpServerApplicationTest() : ApplicationTestBase() {} | 
|   93   ~HttpServerApplicationTest() override {} |   93   ~HttpServerApplicationTest() override {} | 
|   94  |   94  | 
|   95  protected: |   95  protected: | 
|   96   // ApplicationTestBase: |   96   // ApplicationTestBase: | 
|   97   void SetUp() override { |   97   void SetUp() override { | 
|   98     ApplicationTestBase::SetUp(); |   98     ApplicationTestBase::SetUp(); | 
|   99  |   99  | 
|  100     application_impl()->ConnectToService("mojo:http_server", |  100     application_impl()->ConnectToServiceDeprecated("mojo:http_server", | 
|  101                                          &http_server_factory_); |  101                                                    &http_server_factory_); | 
|  102     application_impl()->ConnectToService("mojo:network_service", |  102     application_impl()->ConnectToServiceDeprecated("mojo:network_service", | 
|  103                                          &network_service_); |  103                                                    &network_service_); | 
|  104   } |  104   } | 
|  105  |  105  | 
|  106   http_server::HttpServerPtr CreateHttpServer(); |  106   http_server::HttpServerPtr CreateHttpServer(); | 
|  107  |  107  | 
|  108   http_server::HttpServerFactoryPtr http_server_factory_; |  108   http_server::HttpServerFactoryPtr http_server_factory_; | 
|  109   mojo::NetworkServicePtr network_service_; |  109   mojo::NetworkServicePtr network_service_; | 
|  110  |  110  | 
|  111  private: |  111  private: | 
|  112   MOJO_DISALLOW_COPY_AND_ASSIGN(HttpServerApplicationTest); |  112   MOJO_DISALLOW_COPY_AND_ASSIGN(HttpServerApplicationTest); | 
|  113 }; |  113 }; | 
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  188   url_request->method = "POST"; |  188   url_request->method = "POST"; | 
|  189   url_request->body.resize(1); |  189   url_request->body.resize(1); | 
|  190   WriteMessageToDataPipe(kExampleMessage, &url_request->body[0]); |  190   WriteMessageToDataPipe(kExampleMessage, &url_request->body[0]); | 
|  191  |  191  | 
|  192   url_loader->Start(url_request.Pass(), base::Bind(&CheckServerResponse)); |  192   url_loader->Start(url_request.Pass(), base::Bind(&CheckServerResponse)); | 
|  193   base::RunLoop run_loop; |  193   base::RunLoop run_loop; | 
|  194   run_loop.Run(); |  194   run_loop.Run(); | 
|  195 } |  195 } | 
|  196  |  196  | 
|  197 }  // namespace http_server |  197 }  // namespace http_server | 
| OLD | NEW |