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

Unified Diff: Source/web/tests/WebFrameTest.cpp

Issue 40323004: Add WebDataSource::appendRedirect for cross-process redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Original patch Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebDataSourceImpl.cpp ('k') | public/web/WebDataSource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 995878ddd6743a00dfa1051fd39e3287e12b7f5a..4b3853d9d01b5c8f15a7c0025afe54cb1418f2de 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -2356,6 +2356,25 @@ TEST_F(WebFrameTest, ReloadWhileProvisional)
webViewHelper.webView()->mainFrame()->dataSource()->request().url());
}
+TEST_F(WebFrameTest, AppendRedirects)
+{
+ const std::string firstURL = "about:blank";
+ const std::string secondURL = "http://www.test.com";
+
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ webViewHelper.initializeAndLoad(firstURL, true);
+
+ WebDataSource* dataSource = webViewHelper.webView()->mainFrame()->dataSource();
+ ASSERT_TRUE(dataSource);
+ dataSource->appendRedirect(toKURL(secondURL));
+
+ WebVector<WebURL> redirects;
+ dataSource->redirectChain(redirects);
+ ASSERT_EQ(2U, redirects.size());
+ EXPECT_EQ(toKURL(firstURL), toKURL(redirects[0].spec().data()));
+ EXPECT_EQ(toKURL(secondURL), toKURL(redirects[1].spec().data()));
+}
+
TEST_F(WebFrameTest, IframeRedirect)
{
registerMockedHttpURLLoad("iframe_redirect.html");
« no previous file with comments | « Source/web/WebDataSourceImpl.cpp ('k') | public/web/WebDataSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698