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

Unified Diff: content/browser/child_process_security_policy_unittest.cc

Issue 7397008: Deprecate RegisterProtocolFactory/(Un)RegisterInterceptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indent. Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/child_process_security_policy_unittest.cc
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc
index 4ef3306e8aee18a28c7b6892a28582db72e3e00b..673766afc20e882849b784de9451db704a9f1c9c 100644
--- a/content/browser/child_process_security_policy_unittest.cc
+++ b/content/browser/child_process_security_policy_unittest.cc
@@ -19,11 +19,18 @@ class ChildProcessSecurityPolicyTest : public testing::Test {
// testing::Test
virtual void SetUp() {
// In the real world, "chrome:" is a handled scheme.
- net::URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme,
- &net::URLRequestTestJob::Factory);
+ RegisterProtocolFactory(chrome::kChromeUIScheme,
+ &net::URLRequestTestJob::Factory);
}
virtual void TearDown() {
- net::URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, NULL);
+ RegisterProtocolFactory(chrome::kChromeUIScheme, NULL);
+ }
+
+ static net::URLRequest::ProtocolFactory* RegisterProtocolFactory(
+ const std::string& scheme,
+ net::URLRequest::ProtocolFactory* factory) {
+ return net::URLRequest::Deprecated::RegisterProtocolFactory(
+ scheme, factory);
}
};
@@ -170,8 +177,7 @@ TEST_F(ChildProcessSecurityPolicyTest, RegisterWebSafeSchemeTest) {
EXPECT_TRUE(p->CanRequestURL(kRendererID, GURL("asdf:rockers")));
// Once we register a ProtocolFactory for "asdf", we default to deny.
- net::URLRequest::RegisterProtocolFactory("asdf",
- &net::URLRequestTestJob::Factory);
+ RegisterProtocolFactory("asdf", &net::URLRequestTestJob::Factory);
EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("asdf:rockers")));
// We can allow new schemes by adding them to the whitelist.
@@ -179,7 +185,7 @@ TEST_F(ChildProcessSecurityPolicyTest, RegisterWebSafeSchemeTest) {
EXPECT_TRUE(p->CanRequestURL(kRendererID, GURL("asdf:rockers")));
// Cleanup.
- net::URLRequest::RegisterProtocolFactory("asdf", NULL);
+ RegisterProtocolFactory("asdf", NULL);
EXPECT_TRUE(p->CanRequestURL(kRendererID, GURL("asdf:rockers")));
p->Remove(kRendererID);
« no previous file with comments | « chrome_frame/test/net/test_automation_provider.cc ('k') | content/browser/renderer_host/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698