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

Side by Side Diff: content/browser/top_document_isolation_browsertest.cc

Issue 2052633002: Extend the ToRenderFrameHost magic to FrameTreeNode* and Shell* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix induced script bug. Created 4 years, 6 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 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 "content/browser/frame_host/frame_tree_node.h" 8 #include "content/browser/frame_host/frame_tree_node.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 void GoBack() { 49 void GoBack() {
50 TestNavigationObserver back_load_observer(shell()->web_contents()); 50 TestNavigationObserver back_load_observer(shell()->web_contents());
51 shell()->web_contents()->GetController().GoBack(); 51 shell()->web_contents()->GetController().GoBack();
52 back_load_observer.Wait(); 52 back_load_observer.Wait();
53 } 53 }
54 54
55 Shell* OpenPopup(FrameTreeNode* opener, const std::string& url) { 55 Shell* OpenPopup(FrameTreeNode* opener, const std::string& url) {
56 GURL gurl = 56 GURL gurl =
57 opener->current_frame_host()->GetLastCommittedURL().Resolve(url); 57 opener->current_frame_host()->GetLastCommittedURL().Resolve(url);
58 return content::OpenPopup(opener->current_frame_host(), gurl, "_blank"); 58 return content::OpenPopup(opener, gurl, "_blank");
59 } 59 }
60 60
61 void RendererInitiatedNavigateToURL(FrameTreeNode* node, const GURL& url) { 61 void RendererInitiatedNavigateToURL(FrameTreeNode* node, const GURL& url) {
62 TestFrameNavigationObserver nav_observer(node); 62 TestFrameNavigationObserver nav_observer(node);
63 ASSERT_TRUE(ExecuteScript(node->current_frame_host(), 63 ASSERT_TRUE(
64 "window.location.href='" + url.spec() + "'")); 64 ExecuteScript(node, "window.location.href='" + url.spec() + "'"));
65 nav_observer.Wait(); 65 nav_observer.Wait();
66 } 66 }
67 67
68 private: 68 private:
69 FrameTreeVisualizer visualizer_; 69 FrameTreeVisualizer visualizer_;
70 }; 70 };
71 71
72 IN_PROC_BROWSER_TEST_F(TopDocumentIsolationTest, SameSiteDeeplyNested) { 72 IN_PROC_BROWSER_TEST_F(TopDocumentIsolationTest, SameSiteDeeplyNested) {
73 if (content::AreAllSitesIsolatedForTesting()) 73 if (content::AreAllSitesIsolatedForTesting())
74 return; // Top Document Isolation is disabled in this mode. 74 return; // Top Document Isolation is disabled in this mode.
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 " C = http://adnetwork.com/", 578 " C = http://adnetwork.com/",
579 DepictFrameTree(root())); 579 DepictFrameTree(root()));
580 EXPECT_EQ( 580 EXPECT_EQ(
581 " Site C ------------ proxies for B\n" 581 " Site C ------------ proxies for B\n"
582 "Where B = default subframe process\n" 582 "Where B = default subframe process\n"
583 " C = http://adnetwork.com/", 583 " C = http://adnetwork.com/",
584 DepictFrameTree(popup_root)); 584 DepictFrameTree(popup_root));
585 } 585 }
586 586
587 } // namespace content 587 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698