Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: mojo/shell/fetcher/about_fetcher_unittest.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mojo/shell/capability_filter_test.cc ('k') | mojo/shell/package_manager/capability_filter_content_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698