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 "mojo/shell/fetcher/about_fetcher.h" | 5 #include "mojo/shell/fetcher/about_fetcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 ~AboutFetcherTest() override {} | 100 ~AboutFetcherTest() override {} |
101 | 101 |
102 protected: | 102 protected: |
103 const TestContentHandler* html_content_handler() const { | 103 const TestContentHandler* html_content_handler() const { |
104 return &html_content_handler_; | 104 return &html_content_handler_; |
105 } | 105 } |
106 | 106 |
107 void ConnectAndWait(const std::string& url) { | 107 void ConnectAndWait(const std::string& url) { |
108 base::RunLoop run_loop; | 108 base::RunLoop run_loop; |
109 | 109 |
110 InterfaceProviderPtr remote_interfaces; | 110 shell::mojom::InterfaceProviderPtr remote_interfaces; |
111 InterfaceRequest<InterfaceProvider> remote_request = | 111 shell::mojom::InterfaceProviderRequest remote_request = |
112 GetProxy(&remote_interfaces); | 112 GetProxy(&remote_interfaces); |
113 // This connection error handler will be called when: | 113 // This connection error handler will be called when: |
114 // - TestContentHandler::StartApplication() has been called (please see | 114 // - TestContentHandler::StartApplication() has been called (please see |
115 // comments in that method); or | 115 // comments in that method); or |
116 // - the application manager fails to fetch the requested URL. | 116 // - the application manager fails to fetch the requested URL. |
117 remote_interfaces.set_connection_error_handler( | 117 remote_interfaces.set_connection_error_handler( |
118 [&run_loop]() { run_loop.Quit(); }); | 118 [&run_loop]() { run_loop.Quit(); }); |
119 | 119 |
120 scoped_ptr<ConnectToApplicationParams> params( | 120 scoped_ptr<ConnectToApplicationParams> params( |
121 new ConnectToApplicationParams); | 121 new ConnectToApplicationParams); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 const URLResponse* response = html_content_handler()->latest_response(); | 172 const URLResponse* response = html_content_handler()->latest_response(); |
173 EXPECT_EQ("about:some_unrecognized_url", response->url); | 173 EXPECT_EQ("about:some_unrecognized_url", response->url); |
174 EXPECT_EQ(404u, response->status_code); | 174 EXPECT_EQ(404u, response->status_code); |
175 EXPECT_EQ("text/html", response->mime_type); | 175 EXPECT_EQ("text/html", response->mime_type); |
176 EXPECT_FALSE(response->body.is_valid()); | 176 EXPECT_FALSE(response->body.is_valid()); |
177 } | 177 } |
178 | 178 |
179 } // namespace | 179 } // namespace |
180 } // namespace shell | 180 } // namespace shell |
181 } // namespace mojo | 181 } // namespace mojo |
OLD | NEW |