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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // comments in that method); or | 128 // comments in that method); or |
129 // - the application manager fails to fetch the requested URL. | 129 // - the application manager fails to fetch the requested URL. |
130 service_provider.set_connection_error_handler( | 130 service_provider.set_connection_error_handler( |
131 [&run_loop]() { run_loop.Quit(); }); | 131 [&run_loop]() { run_loop.Quit(); }); |
132 | 132 |
133 URLRequestPtr request(URLRequest::New()); | 133 URLRequestPtr request(URLRequest::New()); |
134 request->url = url; | 134 request->url = url; |
135 application_manager_->ConnectToApplication( | 135 application_manager_->ConnectToApplication( |
136 nullptr, request.Pass(), std::string(), GURL(), | 136 nullptr, request.Pass(), std::string(), GURL(), |
137 service_provider_request.Pass(), nullptr, shell::CapabilityFilter(), | 137 service_provider_request.Pass(), nullptr, shell::CapabilityFilter(), |
138 base::Closure()); | 138 base::Closure(), shell::EmptyConnectCallback()); |
139 | 139 |
140 run_loop.Run(); | 140 run_loop.Run(); |
141 } | 141 } |
142 | 142 |
143 // Overridden from testing::Test: | 143 // Overridden from testing::Test: |
144 void SetUp() override { | 144 void SetUp() override { |
145 application_manager_.reset(new shell::ApplicationManager(&test_delegate_)); | 145 application_manager_.reset(new shell::ApplicationManager(&test_delegate_)); |
146 application_manager_->SetLoaderForURL( | 146 application_manager_->SetLoaderForURL( |
147 make_scoped_ptr(new TestLoader(&html_content_handler_)), | 147 make_scoped_ptr(new TestLoader(&html_content_handler_)), |
148 GURL("test:html_content_handler")); | 148 GURL("test:html_content_handler")); |
(...skipping 27 matching lines...) Expand all Loading... |
176 | 176 |
177 TEST_F(AboutFetcherTest, UnrecognizedURL) { | 177 TEST_F(AboutFetcherTest, UnrecognizedURL) { |
178 ConnectAndWait("about:some_unrecognized_url"); | 178 ConnectAndWait("about:some_unrecognized_url"); |
179 | 179 |
180 ASSERT_EQ(0u, html_content_handler()->response_number()); | 180 ASSERT_EQ(0u, html_content_handler()->response_number()); |
181 } | 181 } |
182 | 182 |
183 } // namespace | 183 } // namespace |
184 } // namespace runner | 184 } // namespace runner |
185 } // namespace mojo | 185 } // namespace mojo |
OLD | NEW |