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

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

Issue 11931024: Removed static factories for data, ftp, file, and about jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address erikwright's comments Created 7 years, 11 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 public: 53 public:
54 ChildProcessSecurityPolicyTest() : old_browser_client_(NULL) { 54 ChildProcessSecurityPolicyTest() : old_browser_client_(NULL) {
55 } 55 }
56 56
57 virtual void SetUp() { 57 virtual void SetUp() {
58 old_browser_client_ = GetContentClient()->browser(); 58 old_browser_client_ = GetContentClient()->browser();
59 GetContentClient()->set_browser_for_testing(&test_browser_client_); 59 GetContentClient()->set_browser_for_testing(&test_browser_client_);
60 60
61 // Claim to always handle chrome:// URLs because the CPSP's notion of 61 // Claim to always handle chrome:// URLs because the CPSP's notion of
62 // allowing WebUI bindings is hard-wired to this particular scheme. 62 // allowing WebUI bindings is hard-wired to this particular scheme.
63 test_browser_client_.AddScheme("chrome"); 63 test_browser_client_.AddScheme(chrome::kChromeUIScheme);
64
65 // Claim to always handle file:// URLs like the browser would.
66 // net::URLRequest::IsHandledURL() no longer claims support for default
67 // protocols as this is the responsibility of the browser (who is
mmenke 2013/01/22 16:50:37 nit: who -> which
68 // responsible for adding the appropriate ProtocolHandler).
69 test_browser_client_.AddScheme(chrome::kFileScheme);
64 } 70 }
65 71
66 virtual void TearDown() { 72 virtual void TearDown() {
67 test_browser_client_.ClearSchemes(); 73 test_browser_client_.ClearSchemes();
68 GetContentClient()->set_browser_for_testing(old_browser_client_); 74 GetContentClient()->set_browser_for_testing(old_browser_client_);
69 } 75 }
70 76
71 protected: 77 protected:
72 void RegisterTestScheme(const std::string& scheme) { 78 void RegisterTestScheme(const std::string& scheme) {
73 test_browser_client_.AddScheme(scheme); 79 test_browser_client_.AddScheme(scheme);
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be 534 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be
529 // prepared to answer policy questions about renderers who no longer exist. 535 // prepared to answer policy questions about renderers who no longer exist.
530 536
531 // In this case, we default to secure behavior. 537 // In this case, we default to secure behavior.
532 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); 538 EXPECT_FALSE(p->CanRequestURL(kRendererID, url));
533 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); 539 EXPECT_FALSE(p->CanReadFile(kRendererID, file));
534 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); 540 EXPECT_FALSE(p->HasWebUIBindings(kRendererID));
535 } 541 }
536 542
537 } // namespace content 543 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698