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

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

Issue 2036463002: Use nav_entry_id in UpdateTitle for OOPIF-enabled modes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/site_per_process_browsertest.h" 5 #include "content/browser/site_per_process_browsertest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 " |--Site C ------- proxies for A\n" 779 " |--Site C ------- proxies for A\n"
780 " +--Site A ------- proxies for C\n" 780 " +--Site A ------- proxies for C\n"
781 " |--Site A -- proxies for C\n" 781 " |--Site A -- proxies for C\n"
782 " +--Site A -- proxies for C\n" 782 " +--Site A -- proxies for C\n"
783 " +--Site A -- proxies for C\n" 783 " +--Site A -- proxies for C\n"
784 "Where A = http://a.com/\n" 784 "Where A = http://a.com/\n"
785 " C = http://bar.com/", 785 " C = http://bar.com/",
786 DepictFrameTree(root)); 786 DepictFrameTree(root));
787 } 787 }
788 788
789 // Ensure that title updates affect the correct NavigationEntry after a new
790 // subframe navigation with an out-of-process iframe. https://crbug.com/616609.
791 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, TitleAfterCrossSiteIframe) {
792 // Start at an initial page.
793 GURL initial_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
794 EXPECT_TRUE(NavigateToURL(shell(), initial_url));
795
796 // Navigate to a same-site page with a same-site iframe.
797 GURL main_url(embedded_test_server()->GetURL(
798 "a.com", "/cross_site_iframe_factory.html?a(a)"));
799 EXPECT_TRUE(NavigateToURL(shell(), main_url));
800
801 FrameTreeNode* root = web_contents()->GetFrameTree()->root();
802
803 // Make the main frame update its title after the subframe loads.
804 EXPECT_TRUE(ExecuteScript(shell()->web_contents(),
805 "document.querySelector('iframe').onload = "
806 " function() { document.title = 'loaded'; };"));
807 EXPECT_TRUE(
808 ExecuteScript(shell()->web_contents(), "document.title = 'not loaded';"));
809 base::string16 expected_title(base::UTF8ToUTF16("loaded"));
810 TitleWatcher title_watcher(shell()->web_contents(), expected_title);
811
812 // Navigate the iframe cross-site.
813 TestNavigationObserver load_observer(shell()->web_contents());
814 GURL frame_url = embedded_test_server()->GetURL("b.com", "/title2.html");
815 EXPECT_TRUE(
816 ExecuteScript(root->child_at(0)->current_frame_host(),
817 "window.location.href = '" + frame_url.spec() + "';"));
818 load_observer.Wait();
819
820 // Wait for the title to update and ensure it affects the right NavEntry.
821 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
822 NavigationEntry* entry =
823 shell()->web_contents()->GetController().GetLastCommittedEntry();
824 EXPECT_EQ(expected_title, entry->GetTitle());
825 }
826
789 // Class to sniff incoming IPCs for FrameHostMsg_FrameRectChanged messages. 827 // Class to sniff incoming IPCs for FrameHostMsg_FrameRectChanged messages.
790 class FrameRectChangedMessageFilter : public content::BrowserMessageFilter { 828 class FrameRectChangedMessageFilter : public content::BrowserMessageFilter {
791 public: 829 public:
792 FrameRectChangedMessageFilter() 830 FrameRectChangedMessageFilter()
793 : content::BrowserMessageFilter(FrameMsgStart), 831 : content::BrowserMessageFilter(FrameMsgStart),
794 message_loop_runner_(new content::MessageLoopRunner), 832 message_loop_runner_(new content::MessageLoopRunner),
795 frame_rect_received_(false) {} 833 frame_rect_received_(false) {}
796 834
797 bool OnMessageReceived(const IPC::Message& message) override { 835 bool OnMessageReceived(const IPC::Message& message) override {
798 IPC_BEGIN_MESSAGE_MAP(FrameRectChangedMessageFilter, message) 836 IPC_BEGIN_MESSAGE_MAP(FrameRectChangedMessageFilter, message)
(...skipping 6424 matching lines...) Expand 10 before | Expand all | Expand 10 after
7223 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0))); 7261 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)));
7224 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0))); 7262 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0)));
7225 7263
7226 // Cross-site navigation should preserve the fullscreen flags. 7264 // Cross-site navigation should preserve the fullscreen flags.
7227 NavigateFrameToURL(root->child_at(0)->child_at(0), 7265 NavigateFrameToURL(root->child_at(0)->child_at(0),
7228 embedded_test_server()->GetURL("d.com", "/title1.html")); 7266 embedded_test_server()->GetURL("d.com", "/title1.html"));
7229 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0))); 7267 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0)));
7230 } 7268 }
7231 7269
7232 } // namespace content 7270 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698