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

Side by Side Diff: content/child/site_isolation_policy_browsertest.cc

Issue 803813003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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
« no previous file with comments | « content/child/site_isolation_policy.cc ('k') | content/child/web_url_loader_impl.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "content/public/common/content_switches.h" 6 #include "content/public/common/content_switches.h"
7 #include "content/public/test/browser_test_utils.h" 7 #include "content/public/test/browser_test_utils.h"
8 #include "content/public/test/content_browser_test.h" 8 #include "content/public/test/content_browser_test.h"
9 #include "content/public/test/content_browser_test_utils.h" 9 #include "content/public/test/content_browser_test_utils.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 // These tests simulate exploited renderer processes, which can fetch arbitrary 13 // These tests simulate exploited renderer processes, which can fetch arbitrary
14 // resources from other websites, not constrained by the Same Origin Policy. We 14 // resources from other websites, not constrained by the Same Origin Policy. We
15 // are trying to verify that the renderer cannot fetch any cross-site document 15 // are trying to verify that the renderer cannot fetch any cross-site document
16 // responses even when the Same Origin Policy is turned off inside the renderer. 16 // responses even when the Same Origin Policy is turned off inside the renderer.
17 class SiteIsolationPolicyBrowserTest : public ContentBrowserTest { 17 class SiteIsolationPolicyBrowserTest : public ContentBrowserTest {
18 public: 18 public:
19 SiteIsolationPolicyBrowserTest() {} 19 SiteIsolationPolicyBrowserTest() {}
20 ~SiteIsolationPolicyBrowserTest() override {} 20 ~SiteIsolationPolicyBrowserTest() override {}
21 21
22 void SetUpCommandLine(CommandLine* command_line) override { 22 void SetUpCommandLine(base::CommandLine* command_line) override {
23 ASSERT_TRUE(test_server()->Start()); 23 ASSERT_TRUE(test_server()->Start());
24 net::SpawnedTestServer https_server( 24 net::SpawnedTestServer https_server(
25 net::SpawnedTestServer::TYPE_HTTPS, 25 net::SpawnedTestServer::TYPE_HTTPS,
26 net::SpawnedTestServer::kLocalhost, 26 net::SpawnedTestServer::kLocalhost,
27 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); 27 base::FilePath(FILE_PATH_LITERAL("content/test/data")));
28 ASSERT_TRUE(https_server.Start()); 28 ASSERT_TRUE(https_server.Start());
29 29
30 // Add a host resolver rule to map all outgoing requests to the test server. 30 // Add a host resolver rule to map all outgoing requests to the test server.
31 // This allows us to use "real" hostnames in URLs, which we can use to 31 // This allows us to use "real" hostnames in URLs, which we can use to
32 // create arbitrary SiteInstances. 32 // create arbitrary SiteInstances.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // <img>,<link>,<embed>, etc. Since the requested document is blocked, and one 104 // <img>,<link>,<embed>, etc. Since the requested document is blocked, and one
105 // character string (' ') is returned instead, this tests that the renderer 105 // character string (' ') is returned instead, this tests that the renderer
106 // does not crash even when it receives a response body which is " ", whose 106 // does not crash even when it receives a response body which is " ", whose
107 // length is different from what's described in "content-length" for such 107 // length is different from what's described in "content-length" for such
108 // different targets. 108 // different targets.
109 GURL foo("http://foo.com/files/cross_site_document_request_target.html"); 109 GURL foo("http://foo.com/files/cross_site_document_request_target.html");
110 NavigateToURL(shell(), foo); 110 NavigateToURL(shell(), foo);
111 } 111 }
112 112
113 } 113 }
OLDNEW
« no previous file with comments | « content/child/site_isolation_policy.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698