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

Side by Side Diff: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc

Issue 12217095: Remove unused pieces of URLRequestJobFactory API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/custom_handlers/protocol_handler_registry.h" 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 MessageLoop::current()->RunUntilIdle(); 52 MessageLoop::current()->RunUntilIdle();
53 } 53 }
54 54
55 // FakeURLRequestJobFactory returns NULL for all job creation requests and false 55 // FakeURLRequestJobFactory returns NULL for all job creation requests and false
56 // for all IsHandled*() requests. FakeURLRequestJobFactory can be chained to 56 // for all IsHandled*() requests. FakeURLRequestJobFactory can be chained to
57 // ProtocolHandlerRegistry::JobInterceptorFactory so the result of 57 // ProtocolHandlerRegistry::JobInterceptorFactory so the result of
58 // MaybeCreateJobWithProtocolHandler() indicates whether the 58 // MaybeCreateJobWithProtocolHandler() indicates whether the
59 // ProtocolHandlerRegistry properly handled a job creation request. 59 // ProtocolHandlerRegistry properly handled a job creation request.
60 class FakeURLRequestJobFactory : public net::URLRequestJobFactory { 60 class FakeURLRequestJobFactory : public net::URLRequestJobFactory {
61 // net::URLRequestJobFactory implementation: 61 // net::URLRequestJobFactory implementation:
62 virtual bool SetProtocolHandler(const std::string& scheme,
63 ProtocolHandler* protocol_handler) OVERRIDE {
64 return false;
65 }
66 virtual void AddInterceptor(Interceptor* interceptor) OVERRIDE {
67 }
68 virtual net::URLRequestJob* MaybeCreateJobWithInterceptor(
69 net::URLRequest* request,
70 net::NetworkDelegate* network_delegate) const OVERRIDE {
71 return NULL;
72 }
73 virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( 62 virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
74 const std::string& scheme, 63 const std::string& scheme,
75 net::URLRequest* request, 64 net::URLRequest* request,
76 net::NetworkDelegate* network_delegate) const OVERRIDE { 65 net::NetworkDelegate* network_delegate) const OVERRIDE {
77 return NULL; 66 return NULL;
78 } 67 }
79 virtual net::URLRequestJob* MaybeInterceptRedirect(
80 const GURL& location,
81 net::URLRequest* request,
82 net::NetworkDelegate* network_delegate) const OVERRIDE {
83 return NULL;
84 }
85 virtual net::URLRequestJob* MaybeInterceptResponse(
86 net::URLRequest* request,
87 net::NetworkDelegate* network_delegate) const OVERRIDE {
88 return NULL;
89 }
90 virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE { 68 virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE {
91 return false; 69 return false;
92 } 70 }
93 virtual bool IsHandledURL(const GURL& url) const OVERRIDE { 71 virtual bool IsHandledURL(const GURL& url) const OVERRIDE {
94 return false; 72 return false;
95 } 73 }
96 }; 74 };
97 75
98 void AssertWillHandleIO( 76 void AssertWillHandleIO(
99 const std::string& scheme, 77 const std::string& scheme,
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 918
941 TEST_F(ProtocolHandlerRegistryTest, MAYBE_TestInstallDefaultHandler) { 919 TEST_F(ProtocolHandlerRegistryTest, MAYBE_TestInstallDefaultHandler) {
942 RecreateRegistry(false); 920 RecreateRegistry(false);
943 registry()->AddPredefinedHandler(CreateProtocolHandler( 921 registry()->AddPredefinedHandler(CreateProtocolHandler(
944 "test", GURL("http://test.com/%s"), "Test")); 922 "test", GURL("http://test.com/%s"), "Test"));
945 registry()->InitProtocolSettings(); 923 registry()->InitProtocolSettings();
946 std::vector<std::string> protocols; 924 std::vector<std::string> protocols;
947 registry()->GetRegisteredProtocols(&protocols); 925 registry()->GetRegisteredProtocols(&protocols);
948 ASSERT_EQ(static_cast<size_t>(1), protocols.size()); 926 ASSERT_EQ(static_cast<size_t>(1), protocols.size());
949 } 927 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698