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

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

Issue 2321503002: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Rebase after a month... Created 4 years, 1 month 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 (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 6796 matching lines...) Expand 10 before | Expand all | Expand 10 after
6807 TestNavigationObserver load_observer(shell()->web_contents()); 6807 TestNavigationObserver load_observer(shell()->web_contents());
6808 EXPECT_TRUE(ExecuteScript(shell(), "frames[0].location.href = '" + 6808 EXPECT_TRUE(ExecuteScript(shell(), "frames[0].location.href = '" +
6809 blocked_urls[i].spec() + "';")); 6809 blocked_urls[i].spec() + "';"));
6810 load_observer.Wait(); 6810 load_observer.Wait();
6811 6811
6812 // The blocked frame's origin should become unique. 6812 // The blocked frame's origin should become unique.
6813 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); 6813 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize());
6814 6814
6815 // Ensure that we don't use the blocked URL as the blocked frame's last 6815 // Ensure that we don't use the blocked URL as the blocked frame's last
6816 // committed URL (see https://crbug.com/622385). 6816 // committed URL (see https://crbug.com/622385).
6817 EXPECT_NE(root->child_at(0)->current_frame_host()->GetLastCommittedURL(), 6817 EXPECT_NE(root->child_at(0)->current_frame_host()->last_successful_url(),
6818 blocked_urls[i]); 6818 blocked_urls[i]);
6819 6819
6820 // The blocked frame should still fire a load event in its parent's process. 6820 // The blocked frame should still fire a load event in its parent's process.
6821 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); 6821 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
6822 6822
6823 // Check that the current RenderFrameHost has stopped loading. 6823 // Check that the current RenderFrameHost has stopped loading.
6824 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); 6824 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading());
6825 6825
6826 // The blocked navigation should behave like an empty 200 response. Make 6826 // The blocked navigation should behave like an empty 200 response. Make
6827 // sure that the frame's document.title is empty: this double-checks both 6827 // sure that the frame's document.title is empty: this double-checks both
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
8516 EXPECT_TRUE(NavigateToURL(shell(), b_url)); 8516 EXPECT_TRUE(NavigateToURL(shell(), b_url));
8517 8517
8518 base::string16 expected_title(base::UTF8ToUTF16("foo")); 8518 base::string16 expected_title(base::UTF8ToUTF16("foo"));
8519 TitleWatcher title_watcher(popup2->web_contents(), expected_title); 8519 TitleWatcher title_watcher(popup2->web_contents(), expected_title);
8520 EXPECT_TRUE(ExecuteScript( 8520 EXPECT_TRUE(ExecuteScript(
8521 shell(), "window.open('','popup2').postMessage('foo', '*');")); 8521 shell(), "window.open('','popup2').postMessage('foo', '*');"));
8522 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); 8522 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
8523 } 8523 }
8524 8524
8525 } // namespace content 8525 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_resource_throttle.cc ('k') | content/public/browser/navigation_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698