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

Side by Side Diff: content/browser/renderer_host/render_message_filter_browsertest.cc

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Attempt to fix compile. Created 5 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 EXPECT_EQ("A=1; B=2; C=3; D=4", 99 EXPECT_EQ("A=1; B=2; C=3; D=4",
100 GetCookieFromJS(web_contents_https->GetMainFrame())); 100 GetCookieFromJS(web_contents_https->GetMainFrame()));
101 EXPECT_EQ("B=2; D=4", GetCookieFromJS(web_contents_http->GetMainFrame())); 101 EXPECT_EQ("B=2; D=4", GetCookieFromJS(web_contents_http->GetMainFrame()));
102 } 102 }
103 103
104 // The RenderMessageFilter will kill processes when they access the cookies of 104 // The RenderMessageFilter will kill processes when they access the cookies of
105 // sites other than the site the process is dedicated to, under site isolation. 105 // sites other than the site the process is dedicated to, under site isolation.
106 IN_PROC_BROWSER_TEST_F(RenderMessageFilterBrowserTest, 106 IN_PROC_BROWSER_TEST_F(RenderMessageFilterBrowserTest,
107 CrossSiteCookieSecurityEnforcement) { 107 CrossSiteCookieSecurityEnforcement) {
108 // The code under test is only active under site isolation. 108 // The code under test is only active under site isolation.
109 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 109 if (!AreAllSitesIsolatedForTesting()) {
110 switches::kSitePerProcess)) {
111 return; 110 return;
112 } 111 }
113 112
114 host_resolver()->AddRule("*", "127.0.0.1"); 113 host_resolver()->AddRule("*", "127.0.0.1");
115 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 114 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
116 SetupCrossSiteRedirector(embedded_test_server()); 115 SetupCrossSiteRedirector(embedded_test_server());
117 NavigateToURL(shell(), 116 NavigateToURL(shell(),
118 embedded_test_server()->GetURL("/frame_with_load_event.html")); 117 embedded_test_server()->GetURL("/frame_with_load_event.html"));
119 118
120 WebContentsImpl* tab = static_cast<WebContentsImpl*>(shell()->web_contents()); 119 WebContentsImpl* tab = static_cast<WebContentsImpl*>(shell()->web_contents());
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 168
170 main_frame_killed.Wait(); 169 main_frame_killed.Wait();
171 170
172 EXPECT_EQ( 171 EXPECT_EQ(
173 " Site A\n" 172 " Site A\n"
174 "Where A = http://127.0.0.1/ (no process)", 173 "Where A = http://127.0.0.1/ (no process)",
175 v.DepictFrameTree(tab->GetFrameTree()->root())); 174 v.DepictFrameTree(tab->GetFrameTree()->root()));
176 } 175 }
177 176
178 } // namespace content 177 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698