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

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: 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
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/frame_tree_node.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 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"
13 #include "content/public/common/url_constants.h" 11 #include "content/public/common/url_constants.h"
14 #include "content/public/test/browser_test_utils.h" 12 #include "content/public/test/browser_test_utils.h"
15 #include "content/public/test/content_browser_test.h" 13 #include "content/public/test/content_browser_test.h"
16 #include "content/public/test/content_browser_test_utils.h" 14 #include "content/public/test/content_browser_test_utils.h"
17 #include "content/public/test/test_navigation_observer.h" 15 #include "content/public/test/test_navigation_observer.h"
18 #include "content/public/test/test_utils.h" 16 #include "content/public/test/test_utils.h"
19 #include "content/shell/browser/shell.h" 17 #include "content/shell/browser/shell.h"
20 #include "content/test/content_browser_test_utils_internal.h" 18 #include "content/test/content_browser_test_utils_internal.h"
21 #include "net/dns/mock_host_resolver.h" 19 #include "net/dns/mock_host_resolver.h"
22 #include "net/test/embedded_test_server/embedded_test_server.h" 20 #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. 310 // Close the original window. This should clear the new window's opener.
313 shell()->Close(); 311 shell()->Close();
314 EXPECT_EQ(nullptr, popup_root->opener()); 312 EXPECT_EQ(nullptr, popup_root->opener());
315 } 313 }
316 314
317 class CrossProcessFrameTreeBrowserTest : public ContentBrowserTest { 315 class CrossProcessFrameTreeBrowserTest : public ContentBrowserTest {
318 public: 316 public:
319 CrossProcessFrameTreeBrowserTest() {} 317 CrossProcessFrameTreeBrowserTest() {}
320 318
321 void SetUpCommandLine(base::CommandLine* command_line) override { 319 void SetUpCommandLine(base::CommandLine* command_line) override {
322 command_line->AppendSwitch(switches::kSitePerProcess); 320 IsolateAllSitesForTesting(command_line);
323 } 321 }
324 322
325 void SetUpOnMainThread() override { 323 void SetUpOnMainThread() override {
326 host_resolver()->AddRule("*", "127.0.0.1"); 324 host_resolver()->AddRule("*", "127.0.0.1");
327 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 325 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
328 SetupCrossSiteRedirector(embedded_test_server()); 326 SetupCrossSiteRedirector(embedded_test_server());
329 } 327 }
330 328
331 private: 329 private:
332 DISALLOW_COPY_AND_ASSIGN(CrossProcessFrameTreeBrowserTest); 330 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"); 424 GURL data_url("data:text/html,foo");
427 NavigateFrameToURL(root->child_at(1), data_url); 425 NavigateFrameToURL(root->child_at(1), data_url);
428 426
429 // Navigating to a data URL should set a unique origin. This is represented 427 // Navigating to a data URL should set a unique origin. This is represented
430 // as "null" per RFC 6454. 428 // as "null" per RFC 6454.
431 EXPECT_EQ(root->child_at(1)->current_replication_state().origin.Serialize(), 429 EXPECT_EQ(root->child_at(1)->current_replication_state().origin.Serialize(),
432 "null"); 430 "null");
433 } 431 }
434 432
435 } // namespace content 433 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698