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

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

Issue 1358533004: Move more of ContentHandler handling into PackageManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 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
« no previous file with comments | « mojo/BUILD.gn ('k') | mojo/mojo_shell.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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/path_service.h" 9 #include "base/path_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 run_loop.Run(); 119 run_loop.Run();
120 } 120 }
121 121
122 // Overridden from testing::Test: 122 // Overridden from testing::Test:
123 void SetUp() override { 123 void SetUp() override {
124 runner::Context::EnsureEmbedderIsInitialized(); 124 runner::Context::EnsureEmbedderIsInitialized();
125 base::FilePath shell_dir; 125 base::FilePath shell_dir;
126 PathService::Get(base::DIR_MODULE, &shell_dir); 126 PathService::Get(base::DIR_MODULE, &shell_dir);
127 scoped_ptr<package_manager::PackageManagerImpl> package_manager( 127 scoped_ptr<package_manager::PackageManagerImpl> package_manager(
128 new package_manager::PackageManagerImpl(shell_dir)); 128 new package_manager::PackageManagerImpl(shell_dir, nullptr));
129 package_manager->RegisterContentHandler( 129 package_manager->RegisterContentHandler(
130 "text/html", GURL("test:html_content_handler")); 130 "text/html", GURL("test:html_content_handler"));
131 application_manager_.reset( 131 application_manager_.reset(
132 new shell::ApplicationManager(package_manager.Pass())); 132 new shell::ApplicationManager(package_manager.Pass()));
133 application_manager_->SetLoaderForURL( 133 application_manager_->SetLoaderForURL(
134 make_scoped_ptr(new TestLoader(&html_content_handler_)), 134 make_scoped_ptr(new TestLoader(&html_content_handler_)),
135 GURL("test:html_content_handler")); 135 GURL("test:html_content_handler"));
136 } 136 }
137 137
138 void TearDown() override { application_manager_.reset(); } 138 void TearDown() override { application_manager_.reset(); }
(...skipping 27 matching lines...) Expand all
166 const URLResponse* response = html_content_handler()->latest_response(); 166 const URLResponse* response = html_content_handler()->latest_response();
167 EXPECT_EQ("about:some_unrecognized_url", response->url); 167 EXPECT_EQ("about:some_unrecognized_url", response->url);
168 EXPECT_EQ(404u, response->status_code); 168 EXPECT_EQ(404u, response->status_code);
169 EXPECT_EQ("text/html", response->mime_type); 169 EXPECT_EQ("text/html", response->mime_type);
170 EXPECT_FALSE(response->body.is_valid()); 170 EXPECT_FALSE(response->body.is_valid());
171 } 171 }
172 172
173 } // namespace 173 } // namespace
174 } // namespace fetcher 174 } // namespace fetcher
175 } // namespace mojo 175 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/BUILD.gn ('k') | mojo/mojo_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698