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

Side by Side Diff: content/browser/child_process_security_policy_unittest.cc

Issue 8623001: Move remaining about: handlers to webUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/common/test_url_constants.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/platform_file.h" 9 #include "base/platform_file.h"
10 #include "content/browser/child_process_security_policy.h" 10 #include "content/browser/child_process_security_policy.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:memory"))); 122 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:memory")));
123 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:crash"))); 123 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:crash")));
124 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:cache"))); 124 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:cache")));
125 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:hang"))); 125 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:hang")));
126 126
127 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("aBoUt:memory"))); 127 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("aBoUt:memory")));
128 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:CrASh"))); 128 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:CrASh")));
129 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("abOuT:cAChe"))); 129 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("abOuT:cAChe")));
130 130
131 // These requests for about: pages should be denied. 131 // These requests for about: pages should be denied.
132 p->GrantRequestURL(kRendererID, GURL(chrome::kTestMemoryURL)); 132 p->GrantRequestURL(kRendererID, GURL(chrome::kTestGpuCleanURL));
133 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kTestMemoryURL))); 133 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kTestGpuCleanURL)));
134 134
135 p->GrantRequestURL(kRendererID, GURL(chrome::kAboutCrashURL)); 135 p->GrantRequestURL(kRendererID, GURL(chrome::kAboutCrashURL));
136 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCrashURL))); 136 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCrashURL)));
137 137
138 p->GrantRequestURL(kRendererID, GURL(chrome::kTestCacheURL)); 138 p->GrantRequestURL(kRendererID, GURL(chrome::kTestCacheURL));
139 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kTestCacheURL))); 139 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kTestCacheURL)));
140 140
141 p->GrantRequestURL(kRendererID, GURL(chrome::kTestHangURL)); 141 p->GrantRequestURL(kRendererID, GURL(chrome::kTestHangURL));
142 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kTestHangURL))); 142 EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kTestHangURL)));
143 143
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 430
431 // Renderers are added and removed on the UI thread, but the policy can be 431 // Renderers are added and removed on the UI thread, but the policy can be
432 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be 432 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be
433 // prepared to answer policy questions about renderers who no longer exist. 433 // prepared to answer policy questions about renderers who no longer exist.
434 434
435 // In this case, we default to secure behavior. 435 // In this case, we default to secure behavior.
436 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); 436 EXPECT_FALSE(p->CanRequestURL(kRendererID, url));
437 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); 437 EXPECT_FALSE(p->CanReadFile(kRendererID, file));
438 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); 438 EXPECT_FALSE(p->HasWebUIBindings(kRendererID));
439 } 439 }
OLDNEW
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/common/test_url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698