| 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 24 matching lines...) Expand all Loading... |
| 35 public mojom::ContentHandler { | 35 public mojom::ContentHandler { |
| 36 public: | 36 public: |
| 37 TestContentHandler() : response_number_(0) {} | 37 TestContentHandler() : response_number_(0) {} |
| 38 ~TestContentHandler() override {} | 38 ~TestContentHandler() override {} |
| 39 | 39 |
| 40 size_t response_number() const { return response_number_; } | 40 size_t response_number() const { return response_number_; } |
| 41 const URLResponse* latest_response() const { return latest_response_.get(); } | 41 const URLResponse* latest_response() const { return latest_response_.get(); } |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // Overridden from ApplicationDelegate: | 44 // Overridden from ApplicationDelegate: |
| 45 void Initialize(ApplicationImpl* app) override {} | 45 void Initialize(Shell* shell, const std::string& url, uint32_t id) override {} |
| 46 bool AcceptConnection(ApplicationConnection* connection) override { | 46 bool AcceptConnection(ApplicationConnection* connection) override { |
| 47 connection->AddService<mojom::ContentHandler>(this); | 47 connection->AddService<mojom::ContentHandler>(this); |
| 48 return true; | 48 return true; |
| 49 } | 49 } |
| 50 | 50 |
| 51 // Overridden from InterfaceFactory<mojom::ContentHandler>: | 51 // Overridden from InterfaceFactory<mojom::ContentHandler>: |
| 52 void Create(ApplicationConnection* connection, | 52 void Create(ApplicationConnection* connection, |
| 53 InterfaceRequest<mojom::ContentHandler> request) override { | 53 InterfaceRequest<mojom::ContentHandler> request) override { |
| 54 bindings_.AddBinding(this, std::move(request)); | 54 bindings_.AddBinding(this, std::move(request)); |
| 55 } | 55 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 const URLResponse* response = html_content_handler()->latest_response(); | 173 const URLResponse* response = html_content_handler()->latest_response(); |
| 174 EXPECT_EQ("about:some_unrecognized_url", response->url); | 174 EXPECT_EQ("about:some_unrecognized_url", response->url); |
| 175 EXPECT_EQ(404u, response->status_code); | 175 EXPECT_EQ(404u, response->status_code); |
| 176 EXPECT_EQ("text/html", response->mime_type); | 176 EXPECT_EQ("text/html", response->mime_type); |
| 177 EXPECT_FALSE(response->body.is_valid()); | 177 EXPECT_FALSE(response->body.is_valid()); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace | 180 } // namespace |
| 181 } // namespace shell | 181 } // namespace shell |
| 182 } // namespace mojo | 182 } // namespace mojo |
| OLD | NEW |