| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "mojo/application/public/cpp/application_impl.h" | |
| 16 #include "mojo/application/public/cpp/application_test_base.h" | |
| 17 #include "mojo/common/data_pipe_utils.h" | 15 #include "mojo/common/data_pipe_utils.h" |
| 18 #include "mojo/public/cpp/system/macros.h" | 16 #include "mojo/public/cpp/system/macros.h" |
| 19 #include "mojo/runner/kPingable.h" | 17 #include "mojo/runner/kPingable.h" |
| 20 #include "mojo/runner/test/pingable.mojom.h" | 18 #include "mojo/runner/test/pingable.mojom.h" |
| 21 #include "mojo/services/http_server/public/cpp/http_server_util.h" | 19 #include "mojo/services/http_server/public/cpp/http_server_util.h" |
| 22 #include "mojo/services/http_server/public/interfaces/http_server.mojom.h" | 20 #include "mojo/services/http_server/public/interfaces/http_server.mojom.h" |
| 23 #include "mojo/services/http_server/public/interfaces/http_server_factory.mojom.
h" | 21 #include "mojo/services/http_server/public/interfaces/http_server_factory.mojom.
h" |
| 24 #include "mojo/services/network/public/interfaces/net_address.mojom.h" | 22 #include "mojo/services/network/public/interfaces/net_address.mojom.h" |
| 23 #include "mojo/shell/public/cpp/application_impl.h" |
| 24 #include "mojo/shell/public/cpp/application_test_base.h" |
| 25 | 25 |
| 26 namespace mojo { | 26 namespace mojo { |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 std::string GetURL(uint16_t port, const std::string& path) { | 29 std::string GetURL(uint16_t port, const std::string& path) { |
| 30 return base::StringPrintf("http://127.0.0.1:%u/%s", | 30 return base::StringPrintf("http://127.0.0.1:%u/%s", |
| 31 static_cast<unsigned>(port), path.c_str()); | 31 static_cast<unsigned>(port), path.c_str()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 class GetHandler : public http_server::HttpHandler { | 34 class GetHandler : public http_server::HttpHandler { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url); | 192 EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url); |
| 193 EXPECT_EQ("hello", message); | 193 EXPECT_EQ("hello", message); |
| 194 base::MessageLoop::current()->QuitWhenIdle(); | 194 base::MessageLoop::current()->QuitWhenIdle(); |
| 195 }; | 195 }; |
| 196 pingable->Ping("hello", callback); | 196 pingable->Ping("hello", callback); |
| 197 base::RunLoop().Run(); | 197 base::RunLoop().Run(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace | 200 } // namespace |
| 201 } // namespace mojo | 201 } // namespace mojo |
| OLD | NEW |