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

Side by Side Diff: chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc

Issue 5607004: net: Remove typedef net::URLRequestJob URLRequestJob; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 2 Created 10 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <vector> 5 #include <vector>
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "chrome/browser/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 // Intercepts requests for the given protocol. 249 // Intercepts requests for the given protocol.
250 void HandleScheme(const std::string& scheme) { 250 void HandleScheme(const std::string& scheme) {
251 DCHECK(scheme_.empty()); 251 DCHECK(scheme_.empty());
252 DCHECK(!old_factory_); 252 DCHECK(!old_factory_);
253 scheme_ = scheme; 253 scheme_ = scheme;
254 old_factory_ = net::URLRequest::RegisterProtocolFactory( 254 old_factory_ = net::URLRequest::RegisterProtocolFactory(
255 scheme_, &ResourceDispatcherHostTest::Factory); 255 scheme_, &ResourceDispatcherHostTest::Factory);
256 } 256 }
257 257
258 // Our own URLRequestJob factory. 258 // Our own net::URLRequestJob factory.
259 static URLRequestJob* Factory(net::URLRequest* request, 259 static net::URLRequestJob* Factory(net::URLRequest* request,
260 const std::string& scheme) { 260 const std::string& scheme) {
261 if (test_fixture_->response_headers_.empty()) { 261 if (test_fixture_->response_headers_.empty()) {
262 return new URLRequestTestJob(request); 262 return new URLRequestTestJob(request);
263 } else { 263 } else {
264 return new URLRequestTestJob(request, test_fixture_->response_headers_, 264 return new URLRequestTestJob(request, test_fixture_->response_headers_,
265 test_fixture_->response_data_, false); 265 test_fixture_->response_data_, false);
266 } 266 }
267 } 267 }
268 268
269 MessageLoopForIO message_loop_; 269 MessageLoopForIO message_loop_;
270 BrowserThread ui_thread_; 270 BrowserThread ui_thread_;
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 EXPECT_TRUE(request_info_->replace_extension_localization_templates()); 1027 EXPECT_TRUE(request_info_->replace_extension_localization_templates());
1028 } 1028 }
1029 1029
1030 TEST_F(ApplyExtensionLocalizationFilterTest, GoodSchemeWrongResourceType) { 1030 TEST_F(ApplyExtensionLocalizationFilterTest, GoodSchemeWrongResourceType) {
1031 resource_type_ = ResourceType::MAIN_FRAME; 1031 resource_type_ = ResourceType::MAIN_FRAME;
1032 ResourceDispatcherHost::ApplyExtensionLocalizationFilter(*url_, 1032 ResourceDispatcherHost::ApplyExtensionLocalizationFilter(*url_,
1033 resource_type_, request_info_.get()); 1033 resource_type_, request_info_.get());
1034 1034
1035 EXPECT_FALSE(request_info_->replace_extension_localization_templates()); 1035 EXPECT_FALSE(request_info_->replace_extension_localization_templates());
1036 } 1036 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698