diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 21:06:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 21:06:25 +0000 |
commit | e0d481585dfab19c0b01b7518080164fa001d54c (patch) | |
tree | ac4b3d806f6917093c8d1f6319d25381934d7211 /chrome/browser/child_process_security_policy_unittest.cc | |
parent | a4c1eb2d00a9c66b4fc809916081cc727c998414 (diff) | |
download | chromium_src-e0d481585dfab19c0b01b7518080164fa001d54c.zip chromium_src-e0d481585dfab19c0b01b7518080164fa001d54c.tar.gz chromium_src-e0d481585dfab19c0b01b7518080164fa001d54c.tar.bz2 |
Replace a bunch of hardcoded URLs with constants from url_constants.h
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/193092
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/child_process_security_policy_unittest.cc')
-rw-r--r-- | chrome/browser/child_process_security_policy_unittest.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/chrome/browser/child_process_security_policy_unittest.cc b/chrome/browser/child_process_security_policy_unittest.cc index 87fd0dc..2cfb489 100644 --- a/chrome/browser/child_process_security_policy_unittest.cc +++ b/chrome/browser/child_process_security_policy_unittest.cc @@ -30,12 +30,12 @@ static int kRendererID = 42; TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) { ChildProcessSecurityPolicy* p = ChildProcessSecurityPolicy::GetInstance(); - EXPECT_TRUE(p->IsWebSafeScheme("http")); - EXPECT_TRUE(p->IsWebSafeScheme("https")); - EXPECT_TRUE(p->IsWebSafeScheme("ftp")); - EXPECT_TRUE(p->IsWebSafeScheme("data")); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kHttpScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kHttpsScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kFtpScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kDataScheme)); EXPECT_TRUE(p->IsWebSafeScheme("feed")); - EXPECT_TRUE(p->IsWebSafeScheme("chrome-extension")); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kExtensionScheme)); EXPECT_FALSE(p->IsWebSafeScheme("registered-web-safe-scheme")); p->RegisterWebSafeScheme("registered-web-safe-scheme"); @@ -45,9 +45,9 @@ TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) { TEST_F(ChildProcessSecurityPolicyTest, IsPseudoSchemeTest) { ChildProcessSecurityPolicy* p = ChildProcessSecurityPolicy::GetInstance(); - EXPECT_TRUE(p->IsPseudoScheme("about")); - EXPECT_TRUE(p->IsPseudoScheme("javascript")); - EXPECT_TRUE(p->IsPseudoScheme("view-source")); + EXPECT_TRUE(p->IsPseudoScheme(chrome::kAboutScheme)); + EXPECT_TRUE(p->IsPseudoScheme(chrome::kJavaScriptScheme)); + EXPECT_TRUE(p->IsPseudoScheme(chrome::kViewSourceScheme)); EXPECT_FALSE(p->IsPseudoScheme("registered-psuedo-scheme")); p->RegisterPseudoScheme("registered-psuedo-scheme"); @@ -96,17 +96,17 @@ TEST_F(ChildProcessSecurityPolicyTest, AboutTest) { EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:CrASh"))); EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("abOuT:cAChe"))); - p->GrantRequestURL(kRendererID, GURL("about:memory")); - EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:memory"))); + p->GrantRequestURL(kRendererID, GURL(chrome::kAboutMemoryURL)); + EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutMemoryURL))); - p->GrantRequestURL(kRendererID, GURL("about:crash")); - EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:crash"))); + p->GrantRequestURL(kRendererID, GURL(chrome::kAboutCrashURL)); + EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCrashURL))); - p->GrantRequestURL(kRendererID, GURL("about:cache")); - EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:cache"))); + p->GrantRequestURL(kRendererID, GURL(chrome::kAboutCacheURL)); + EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCacheURL))); - p->GrantRequestURL(kRendererID, GURL("about:hang")); - EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:hang"))); + p->GrantRequestURL(kRendererID, GURL(chrome::kAboutHangURL)); + EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutHangURL))); p->Remove(kRendererID); } |