| 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/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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 ~ShellHTTPAppTest() override {} | 73 ~ShellHTTPAppTest() override {} |
| 74 | 74 |
| 75 protected: | 75 protected: |
| 76 void SetUp() override { | 76 void SetUp() override { |
| 77 ShellAppTest::SetUp(); | 77 ShellAppTest::SetUp(); |
| 78 | 78 |
| 79 application_impl()->ConnectToService("mojo:http_server", | 79 application_impl()->ConnectToService("mojo:http_server", |
| 80 &http_server_factory_); | 80 &http_server_factory_); |
| 81 | 81 |
| 82 mojo::NetAddressPtr local_address(mojo::NetAddress::New()); | 82 mojo::NetAddressPtr local_address(mojo::NetAddress::New()); |
| 83 local_address->family = mojo::NET_ADDRESS_FAMILY_IPV4; | 83 local_address->family = mojo::NetAddressFamily::IPV4; |
| 84 local_address->ipv4 = mojo::NetAddressIPv4::New(); | 84 local_address->ipv4 = mojo::NetAddressIPv4::New(); |
| 85 local_address->ipv4->addr.resize(4); | 85 local_address->ipv4->addr.resize(4); |
| 86 local_address->ipv4->addr[0] = 127; | 86 local_address->ipv4->addr[0] = 127; |
| 87 local_address->ipv4->addr[1] = 0; | 87 local_address->ipv4->addr[1] = 0; |
| 88 local_address->ipv4->addr[2] = 0; | 88 local_address->ipv4->addr[2] = 0; |
| 89 local_address->ipv4->addr[3] = 1; | 89 local_address->ipv4->addr[3] = 1; |
| 90 local_address->ipv4->port = 0; | 90 local_address->ipv4->port = 0; |
| 91 http_server_factory_->CreateHttpServer(mojo::GetProxy(&http_server_), | 91 http_server_factory_->CreateHttpServer(mojo::GetProxy(&http_server_), |
| 92 local_address.Pass()); | 92 local_address.Pass()); |
| 93 | 93 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 EXPECT_TRUE(EndsWith(app_url, "/pingable_app.mojo", true)); | 189 EXPECT_TRUE(EndsWith(app_url, "/pingable_app.mojo", true)); |
| 190 EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url); | 190 EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url); |
| 191 EXPECT_EQ("hello", message); | 191 EXPECT_EQ("hello", message); |
| 192 base::MessageLoop::current()->Quit(); | 192 base::MessageLoop::current()->Quit(); |
| 193 }; | 193 }; |
| 194 pingable->Ping("hello", callback); | 194 pingable->Ping("hello", callback); |
| 195 base::RunLoop().Run(); | 195 base::RunLoop().Run(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace | 198 } // namespace |
| OLD | NEW |