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

Side by Side Diff: content/browser/frame_host/frame_tree_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: rparen 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/frame_tree.h" 5 #include "content/browser/frame_host/frame_tree.h"
7 #include "content/browser/frame_host/frame_tree_node.h" 6 #include "content/browser/frame_host/frame_tree_node.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 7 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 8 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/public/browser/notification_service.h" 9 #include "content/public/browser/notification_service.h"
11 #include "content/public/browser/notification_types.h" 10 #include "content/public/browser/notification_types.h"
12 #include "content/public/common/content_switches.h" 11 #include "content/public/common/site_isolation_policy.h"
13 #include "content/public/common/url_constants.h" 12 #include "content/public/common/url_constants.h"
14 #include "content/public/test/browser_test_utils.h" 13 #include "content/public/test/browser_test_utils.h"
15 #include "content/public/test/content_browser_test.h" 14 #include "content/public/test/content_browser_test.h"
16 #include "content/public/test/content_browser_test_utils.h" 15 #include "content/public/test/content_browser_test_utils.h"
17 #include "content/public/test/test_navigation_observer.h" 16 #include "content/public/test/test_navigation_observer.h"
18 #include "content/public/test/test_utils.h" 17 #include "content/public/test/test_utils.h"
19 #include "content/shell/browser/shell.h" 18 #include "content/shell/browser/shell.h"
20 #include "content/test/content_browser_test_utils_internal.h" 19 #include "content/test/content_browser_test_utils_internal.h"
21 #include "net/dns/mock_host_resolver.h" 20 #include "net/dns/mock_host_resolver.h"
22 #include "net/test/embedded_test_server/embedded_test_server.h" 21 #include "net/test/embedded_test_server/embedded_test_server.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 // Close the original window. This should clear the new window's opener. 311 // Close the original window. This should clear the new window's opener.
313 shell()->Close(); 312 shell()->Close();
314 EXPECT_EQ(nullptr, popup_root->opener()); 313 EXPECT_EQ(nullptr, popup_root->opener());
315 } 314 }
316 315
317 class CrossProcessFrameTreeBrowserTest : public ContentBrowserTest { 316 class CrossProcessFrameTreeBrowserTest : public ContentBrowserTest {
318 public: 317 public:
319 CrossProcessFrameTreeBrowserTest() {} 318 CrossProcessFrameTreeBrowserTest() {}
320 319
321 void SetUpCommandLine(base::CommandLine* command_line) override { 320 void SetUpCommandLine(base::CommandLine* command_line) override {
322 command_line->AppendSwitch(switches::kSitePerProcess); 321 SiteIsolationPolicy::IsolateAllSitesForTesting(command_line);
323 } 322 }
324 323
325 void SetUpOnMainThread() override { 324 void SetUpOnMainThread() override {
326 host_resolver()->AddRule("*", "127.0.0.1"); 325 host_resolver()->AddRule("*", "127.0.0.1");
327 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 326 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
328 SetupCrossSiteRedirector(embedded_test_server()); 327 SetupCrossSiteRedirector(embedded_test_server());
329 } 328 }
330 329
331 private: 330 private:
332 DISALLOW_COPY_AND_ASSIGN(CrossProcessFrameTreeBrowserTest); 331 DISALLOW_COPY_AND_ASSIGN(CrossProcessFrameTreeBrowserTest);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 GURL data_url("data:text/html,foo"); 425 GURL data_url("data:text/html,foo");
427 NavigateFrameToURL(root->child_at(1), data_url); 426 NavigateFrameToURL(root->child_at(1), data_url);
428 427
429 // Navigating to a data URL should set a unique origin. This is represented 428 // Navigating to a data URL should set a unique origin. This is represented
430 // as "null" per RFC 6454. 429 // as "null" per RFC 6454.
431 EXPECT_EQ(root->child_at(1)->current_replication_state().origin.string(), 430 EXPECT_EQ(root->child_at(1)->current_replication_state().origin.string(),
432 "null"); 431 "null");
433 } 432 }
434 433
435 } // namespace content 434 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698