| 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/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "mojo/application/public/cpp/application_connection.h" | 10 #include "mojo/application/public/cpp/application_connection.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // This connection error handler will be called when: | 127 // This connection error handler will be called when: |
| 128 // - TestContentHandler::StartApplication() has been called (please see | 128 // - TestContentHandler::StartApplication() has been called (please see |
| 129 // comments in that method); or | 129 // comments in that method); or |
| 130 // - the application manager fails to fetch the requested URL. | 130 // - the application manager fails to fetch the requested URL. |
| 131 service_provider.set_connection_error_handler( | 131 service_provider.set_connection_error_handler( |
| 132 [&run_loop]() { run_loop.Quit(); }); | 132 [&run_loop]() { run_loop.Quit(); }); |
| 133 | 133 |
| 134 URLRequestPtr request(URLRequest::New()); | 134 URLRequestPtr request(URLRequest::New()); |
| 135 request->url = url; | 135 request->url = url; |
| 136 application_manager_->ConnectToApplication( | 136 application_manager_->ConnectToApplication( |
| 137 nullptr, request.Pass(), std::string(), GURL(), | 137 nullptr, request.Pass(), std::string(), service_provider_request.Pass(), |
| 138 service_provider_request.Pass(), nullptr, shell::CapabilityFilter(), | 138 nullptr, shell::CapabilityFilter(), base::Closure(), |
| 139 base::Closure(), shell::EmptyConnectCallback()); | 139 shell::EmptyConnectCallback()); |
| 140 | 140 |
| 141 run_loop.Run(); | 141 run_loop.Run(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 // Overridden from testing::Test: | 144 // Overridden from testing::Test: |
| 145 void SetUp() override { | 145 void SetUp() override { |
| 146 Context::EnsureEmbedderIsInitialized(); | 146 Context::EnsureEmbedderIsInitialized(); |
| 147 application_manager_.reset(new shell::ApplicationManager(&test_delegate_)); | 147 application_manager_.reset(new shell::ApplicationManager(&test_delegate_)); |
| 148 application_manager_->SetLoaderForURL( | 148 application_manager_->SetLoaderForURL( |
| 149 make_scoped_ptr(new TestLoader(&html_content_handler_)), | 149 make_scoped_ptr(new TestLoader(&html_content_handler_)), |
| (...skipping 28 matching lines...) Expand all Loading... |
| 178 | 178 |
| 179 TEST_F(AboutFetcherTest, UnrecognizedURL) { | 179 TEST_F(AboutFetcherTest, UnrecognizedURL) { |
| 180 ConnectAndWait("about:some_unrecognized_url"); | 180 ConnectAndWait("about:some_unrecognized_url"); |
| 181 | 181 |
| 182 ASSERT_EQ(0u, html_content_handler()->response_number()); | 182 ASSERT_EQ(0u, html_content_handler()->response_number()); |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace | 185 } // namespace |
| 186 } // namespace runner | 186 } // namespace runner |
| 187 } // namespace mojo | 187 } // namespace mojo |
| OLD | NEW |