| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/test/scoped_feature_list.h" | 8 #include "base/test/scoped_feature_list.h" |
| 9 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
| 10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 class TopDocumentIsolationTest : public ContentBrowserTest { | 25 class TopDocumentIsolationTest : public ContentBrowserTest { |
| 26 public: | 26 public: |
| 27 TopDocumentIsolationTest() {} | 27 TopDocumentIsolationTest() {} |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 std::string DepictFrameTree(FrameTreeNode* node) { | 30 std::string DepictFrameTree(FrameTreeNode* node) { |
| 31 return visualizer_.DepictFrameTree(node); | 31 return visualizer_.DepictFrameTree(node); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void SetUp() override { |
| 35 scoped_feature_list_.InitAndEnableFeature(features::kTopDocumentIsolation); |
| 36 ContentBrowserTest::SetUp(); |
| 37 } |
| 38 |
| 34 void SetUpOnMainThread() override { | 39 void SetUpOnMainThread() override { |
| 35 scoped_feature_list_.InitAndEnableFeature(features::kTopDocumentIsolation); | |
| 36 host_resolver()->AddRule("*", "127.0.0.1"); | 40 host_resolver()->AddRule("*", "127.0.0.1"); |
| 37 SetupCrossSiteRedirector(embedded_test_server()); | 41 SetupCrossSiteRedirector(embedded_test_server()); |
| 38 ASSERT_TRUE(embedded_test_server()->Start()); | 42 ASSERT_TRUE(embedded_test_server()->Start()); |
| 39 } | 43 } |
| 40 | 44 |
| 41 FrameTreeNode* root() { | 45 FrameTreeNode* root() { |
| 42 return static_cast<WebContentsImpl*>(shell()->web_contents()) | 46 return static_cast<WebContentsImpl*>(shell()->web_contents()) |
| 43 ->GetFrameTree() | 47 ->GetFrameTree() |
| 44 ->root(); | 48 ->root(); |
| 45 } | 49 } |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 " C = http://adnetwork.com/", | 607 " C = http://adnetwork.com/", |
| 604 DepictFrameTree(root())); | 608 DepictFrameTree(root())); |
| 605 EXPECT_EQ( | 609 EXPECT_EQ( |
| 606 " Site C ------------ proxies for B\n" | 610 " Site C ------------ proxies for B\n" |
| 607 "Where B = default subframe process\n" | 611 "Where B = default subframe process\n" |
| 608 " C = http://adnetwork.com/", | 612 " C = http://adnetwork.com/", |
| 609 DepictFrameTree(popup_root)); | 613 DepictFrameTree(popup_root)); |
| 610 } | 614 } |
| 611 | 615 |
| 612 } // namespace content | 616 } // namespace content |
| OLD | NEW |