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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_child_frame_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: Partial fixes to Nasko's comments. Created 5 years, 5 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 "base/command_line.h"
6 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
7 #include "content/public/browser/render_frame_host.h" 6 #include "content/public/browser/render_frame_host.h"
8 #include "content/public/browser/web_contents.h" 7 #include "content/public/browser/web_contents.h"
9 #include "content/public/common/content_switches.h" 8 #include "content/public/common/site_isolation_policy.h"
10 #include "content/public/test/browser_test_utils.h" 9 #include "content/public/test/browser_test_utils.h"
11 #include "content/public/test/content_browser_test.h" 10 #include "content/public/test/content_browser_test.h"
12 #include "content/public/test/content_browser_test_utils.h" 11 #include "content/public/test/content_browser_test_utils.h"
13 #include "content/public/test/test_utils.h" 12 #include "content/public/test/test_utils.h"
14 #include "content/shell/browser/shell.h" 13 #include "content/shell/browser/shell.h"
15 #include "content/test/content_browser_test_utils_internal.h" 14 #include "content/test/content_browser_test_utils_internal.h"
16 #include "content/test/test_content_browser_client.h" 15 #include "content/test/test_content_browser_client.h"
17 #include "net/dns/mock_host_resolver.h" 16 #include "net/dns/mock_host_resolver.h"
18 #include "net/test/embedded_test_server/embedded_test_server.h" 17 #include "net/test/embedded_test_server/embedded_test_server.h"
19 18
20 namespace content { 19 namespace content {
21 20
22 class RenderWidgetHostViewChildFrameTest : public ContentBrowserTest { 21 class RenderWidgetHostViewChildFrameTest : public ContentBrowserTest {
23 public: 22 public:
24 RenderWidgetHostViewChildFrameTest() {} 23 RenderWidgetHostViewChildFrameTest() {}
25 24
26 void SetUpCommandLine(base::CommandLine* command_line) override { 25 void SetUpCommandLine(base::CommandLine* command_line) override {
27 command_line->AppendSwitch(switches::kSitePerProcess); 26 SiteIsolationPolicy::IsolateAllSitesForTesting(command_line);
28 } 27 }
29 28
30 void SetUpOnMainThread() override { 29 void SetUpOnMainThread() override {
31 host_resolver()->AddRule("*", "127.0.0.1"); 30 host_resolver()->AddRule("*", "127.0.0.1");
32 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 31 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
33 SetupCrossSiteRedirector(embedded_test_server()); 32 SetupCrossSiteRedirector(embedded_test_server());
34 } 33 }
35 34
36 void CheckScreenWidth(RenderFrameHost* render_frame_host) { 35 void CheckScreenWidth(RenderFrameHost* render_frame_host) {
37 int width; 36 int width;
(...skipping 29 matching lines...) Expand all
67 ExecuteScriptAndGetValue(shell()->web_contents()->GetMainFrame(), 66 ExecuteScriptAndGetValue(shell()->web_contents()->GetMainFrame(),
68 "window.screen.width")->GetAsInteger(&main_frame_screen_width); 67 "window.screen.width")->GetAsInteger(&main_frame_screen_width);
69 set_expected_screen_width(main_frame_screen_width); 68 set_expected_screen_width(main_frame_screen_width);
70 EXPECT_FALSE(main_frame_screen_width == 0); 69 EXPECT_FALSE(main_frame_screen_width == 0);
71 70
72 shell()->web_contents()->ForEachFrame( 71 shell()->web_contents()->ForEachFrame(
73 base::Bind(&RenderWidgetHostViewChildFrameTest::CheckScreenWidth, this)); 72 base::Bind(&RenderWidgetHostViewChildFrameTest::CheckScreenWidth, this));
74 } 73 }
75 74
76 } // namespace content 75 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698